Language Reference Guide : System Classes : XMLElement Class : AddChildElement Method
 
Share this page          
AddChildElement Method
The AddChildElement method creates an XMLElement with the given name and adds it to the Children list. If valuetext or valuestring is given, the created XMLElement will get an XMLText or XMLCDATA child (depending on iscdata) with its Value set to either valuetext or valuestring.
This method has the following syntax:
integer = XMLElement.AddChildElement(
          name = varchar(256)
          [, valuestring = StringObject]
          [, valuetext = varchar(2000)]
          [, attributes = Arrayof XMLAttribute]
          [, position = integer]
          [, iscdata = integer]
          [, child = byref(XMLNode)])
This method has the following parameters:
name
(Required) Specifies the name of the XMLElement
valuestring
Specifies that the new child will get an XMLText or XMLCDATA child (depending on iscdata) with its value parameter set to valuestring
valuetext
Specifies that the new child will get an XMLText or XMLCDATA child (depending on iscdata) with its value parameter set to a StringObject with the value of valuetext
attributes
Specifies the attributes of the new XMLElement
position
Specifies the position of the XMLElement in the Children list
iscdata
Specifies that the XMLElement should get an XMLCDATA child with its value parameter set according to the valuestring or valuetext parameter
child
Contains the reference to the newly created XMLElement, which should be used BYREF
If the method is successful, it returns ER_OK; otherwise, it returns ER_FAIL. Descriptions of system constant values and their numeric equivalents are listed in Error Codes.