Import a node from another file into this file. The returned node does not have a parent; (parentNode is null). The origin node is not altered or deleted from the origin file; this method creates a new copy from the origin node.

For all the nodes, import a node creates a node object. It belong to the imported file, with values of nodeName and nodeType attribute identical to the origin node, in addition to the attributes related with namespaces (prefix, localName and namespaceURI).

While the cloneNode operates in a node, the origin is not altered. The additional information is properly copied to the nodeType, trying to imitate the expected behavior if a origin XML or HTML fragment was copied from one document to another. In the XML case the funtion will recognize which both files can have differents DTDs. The following list describes the specifications of each type of node.

1 dom.document.importNode

<dom.document.importNode deep='deep'>
    <node_orig /> !
    <node_import /> !



Appears when the type of imported node is not supported.


Import a XML node to a XML file.

<xsql-script name='dom_importNode'>


        <set name='node_orig'>
            <dom.parse><file name='data1.xml' type='absolute' /></dom.parse>
        <set name='node_import'>
            <dom.parse><file name='data2.xml' type='absolute' /></dom.parse>

        <set name='resul'>
                <node_orig />
                <node_import />