Hello All,
               I have the following scenario where I have to copy a huge XML 
document from one DB to the other.. While Loading it to the other database I 
would like to just copy certain specific nodes and elements  which I am 
interested in  and ignore the rest.
for eg. lets assume this is the whole document
    <root>
       <childList>
         <child>
          <a>a</a>
          <b>b</b>
           <xlist>
                <x>
                    <y> y</y>
                    <z>z</z>
                 </x>
                <x>
                    <y> y1</y>
                    <z>z1</z>
                 </x>
            </xlist>
         </child>
          More child nodes list the one above.. with different values, but have 
the same node structure..
       </childList>
    </root>
Now in the above XML I am interested in root/ChildList/Child however I want 
only the following nodes <a> ,/xlist/x/y  while the document gets stored to the 
DB..I would like to have the following XML saved
    <root>
       <childList>
         <child>
          <a>a</a>
           <xlist>
                <x>
                    <y> y</y>
                 </x>
                <x>
                    <y> y1</y>
                 </x>
            </xlist>
         </child>
          More child nodes list the one above.. with different values, but have 
the same node structure..
       </childList>
    </root>

Is there a best and fastest way to do it, rater than running xquery on the 
document and creating a new XML from scratch?
or there a way I can run this document over an XSD and make it ignore nodes 
which are not part of XSD?
or is there a way I can apply some default filter configured to the Database 
which selects only specific nodes?
Please let me know thoughts on this.

Regards Abishek
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to