Code example for Node

Methods: appendChild

0
		attributes.setNamedItem(createAttribute(document, "testname", "User Defined Variables"));
		attributes.setNamedItem(createAttribute(document, "enabled", "true"));
		appendCollectionProp(document, elementProp, contextType, contextPostData);
 
		//parentNode.setTextContent(null); 
		parentNode.appendChild(elementProp);
	} 
	 
	private static void appendCollectionProp(Document document, Node elementProp, String contextType, String contextPostData) { // collection append in prop
		String argumentValue = null;
		if(contextType.equals(FrameworkConstants.POST)) {
			argumentValue = contextPostData;
		} 
		Node collectionProp = document.createElement("collectionProp");
		NamedNodeMap attributes = collectionProp.getAttributes();
		attributes.setNamedItem(createAttribute(document, "name", "Arguments.arguments"));
 
		Node subElementProp = document.createElement("elementProp");
		NamedNodeMap subElementAttributes = subElementProp.getAttributes();
		subElementAttributes.setNamedItem(createAttribute(document, "name", ""));
		subElementAttributes.setNamedItem(createAttribute(document, "elementType", "HTTPArgument"));