[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

changing node names in XML

Subject: changing node names in XML
From: Vijay Mummaneni <vijaya.mummaneni@xxxxxxx>
Date: Fri, 25 Oct 2002 10:12:37 -0700
mummaneni
Hi,

I need to change the node names in my XML file based on a condition.
If a an element has children then the element name has to become
"folder",
and if an element has no children then its name has to become "leaf".
For example :

<Employees>
       <employee name="emp5" id="5">
              <employee name="emp2" id="2">
                     <employee name="emp1" id="1"/>
                     <employee name="emp4" id="4"/>
            </employee>
            <employee name="emp3" id="3"/>
       </employee>
</Employees>


As :

<Employees>
       <folder  name="emp5" id="5">
              <folder  name="emp2" id="2">
                     <leaf  name="emp1" id="1"/>
                     <leaf  name="emp4" id="4"/>
            </folder>
            <leaf  name="emp3" id="3"/>
       </folder>
</Employees>

I wanted to use XSLT. Do you have a hint how can I achieve that ?

Thanks
vijay



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.