XML node replacement

"P Ram" <[email protected]> Thu, 16 Aug 2007 13:48:05 -0700
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Hi, I am a newbie to XSL and require help. I have two XMLs (see below) and
must convert old to new .

To summarize:

1. I have to replace all node1 with the attribute value for doc_var_name i.e.
var1 (including those occuring within <test> and <child1><chil2> etc)

2. I have to remove all child1, child2 nodes and replace them with one
instance of <children>.

I am unable to figure this one out.

Thanks!
Terry

-----------------------------------
old format:
----------------
<test>
    <node1 doc_var_name="var1>
       <a>1</a>
    </node1>
    <child1>
         <node1 doc_var_name="var2>
                 <b>6</b>
         </node1>
    </child1>
    <child2>
       <node1 doc_var_name="var3>
                 <c>3</c>
         </node1>
    </child2>
</test>


required new format:
-----------------------------
<test>
   <var1 doc_var_name="var1">
      <a>1</a>
   </var1>
   <children>
       <var2 doc_var_name="var2">
          <b>7</b>
       </var2>
        <var3 doc_var_name="var3">
          <c>3</c>
       </var3>
   </children>
</test>

_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list