Portlet Factory, Version 6.1.2
About adding elements to an IXml structure
You can add elements to an IXml structure by retrieving the node to which you want to add an element and calling one of the following IXml methods.
- addChildElement(String)
- Adds an empty element named according to the string passed. For example, the following code adds an existing IXml structure (myIXml):
IXml childElement = myIXml.addChildElement("Customer");- addChildElement(IXml)
- Adds the passed IXml structure as a child of the current node. For example, you could copy a node from one IXml structure to another with the following code:
myIXml.addChildElement(otherIXml.findElement("parent/child").cloneElement());- addChildWithText(String, String)
- Adds an element named according to the first string passed with a value of the second string passed. For example, you could create an element <Customer> with a text value of "Marco" with the following code:
myIXml.addChildWithText("Customer", "Marco");Parent topic: About creating XML structures
Library | Support |