Document Object Model (DOM) is an API which allows to manage documents structured hierarchically. This model, allows to dispose in memory of a hierarchy display of a XML file (or HTML), providing a set of functions to navigate dynamically through the different nodes that compose the structure and analize them. It is also independent of any programming language oriented to objects. DOM is closely related with SOAP. While the response to a SOAP request always consist in a XML file, the receiving application of the document requires a technologie as DOM to explore it. DOM provides the developers flexibility to analize the file. But the fact that the representation of the document is kept in memory during the processing thereof, implies a cost in terms of occupied memory space and CPU capacity. SAX (Simple API for XML).

1 dom.createElement

Create an element and its childs from a XML structure.

<dom.createElement>
    <xml /> !
</dom.createElement>
Example

Creates a node.

Copy
<xsql-script name='dom_createElement'>

    <body>

        <set name='username'>a</set>
        <set name='password'>b</set>

        <set name='root'>
            <dom.createElement>
                 <element name='AuthHeader'>
                    <attributes>
                        <attribute name='xmlns' value='http://tempuri.org/testWS/helloworld' />
                    </attributes>
                    <elements>
                        <element name='UserName'>
                        <value><username /></value>
                    </element>
                        <element name='Password'>
                        <value><password /></value>
                    </element>
                    </elements>
                 </element>
            </dom.createElement>
        </set>

<!--
        It is equivalent to

        <dom.parse>
            <string>
                &lt;AuthHeader _xmlns="http://tempuri.org/testWS/helloworld">
                  &lt;Username><username />&lt;/Username>
                  &lt;Password><password />&lt;/Password>
                &lt;/AuthHeader>
            </string>
        </dom.parse>
-->

        <println><root/></println>

    </body>
</xsql-script>