1 Reply Latest reply on Mar 23, 2010 7:53 AM by AdrianWiecek

    XML & XMLList manipulation

    Sen Imagines Level 1

      Hi,

       

      I have an XML:

       

      <nodes>

           <node name="p1">

                     <node name="ch1">  data1  </ch1>

                     <node name="ch2">  data2  </ch2>

           </node>

           <node name="p2">

                     <node name="ch1">  data3  </ch1>

                     <node name="ch2">  data4  </ch2>

           </node>

      </nodes>

       

      I would like to :

       

      1. create another XML or XMLList which extracts only the root nodes like:

       

           <node name="p1">

           <node name="p2">

       

      2. create another XML when passing the node name like:

       

           generateXML("p2");

       

           output:

           -----------

           <node name="p2">

                     <node name="ch1">  data3  </ch1>

                     <node name="ch2">  data4  </ch2>

           </node>

       

      How can i accomplish the above tasks?