4D v16.3DOM Append XML child node |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
DOM Append XML child node
DOM Append XML child node
The DOM Append XML child node command is used to append the childValue value to the XML node designated by elementRef. The type of node created is specified by the childType parameter. In this parameter you can pass one of the following constants, located in the "XML" theme:
In childValue, pass the data to be inserted. You can pass a string or a 4D variable (string or BLOB). The contents of this parameter will always be converted into text. Note: If the elementRef parameter designates the Document node (top level node), the command inserts a "Doctype" node before any other node. The same goes for processing instructions and comments, which are always inserted before the root node (but after the Doctype node). Adding a text type node: Reference:=DOM Create XML element(elementRef;"myElement") Result: <myElement>Hello<br/>New<br/>York</myElement> Adding a processing instruction type node: $Txt_instruction:="xml-stylesheet type = \"text/xsl\" href=\"style.xsl\"" Result (inserted before first element): <?xml-stylesheet type="text/xsl" href="style.xsl"?> Adding a comment type node: Reference:=DOM Append XML child node(elementRef;XML Comment;"Hello world") Result: <!--Hello world--> Adding a CDATA type node: Reference:=DOM Append XML child node(elementRef;XML CDATA;"12 < 18") Result: <element><![CDATA[12 < 18]]></element> Adding or replacing a Doctype declaration type node: Reference:=DOM Append XML child node(elementRef;XML DOCTYPE;"Books SYSTEM \"Book.DTD\"") Result (inserted before first element): <!DOCTYPE Books SYSTEM "Book.DTD"> Adding or replacing an Element type node.
If the contents of childValue are not valid, an error is returned.
See also
|
PROPERTIES
Product: 4D HISTORY
Created: 4D v12 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||