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

Needed traversing code for ......

Subject: Needed traversing code for ......
From: lvenki@xxxxxxxx
Date: Fri, 15 Sep 2000 17:23:31 GMT
no desc
I have an xml like this- 

 <kwd name="kwd name 1" kwd_group="kwd group 1" interest="interest1, interest2"> 
 <item name="item name 1" item_group="item group 1"> 
 <ctg ctg_no="category no" desc="description1"> 
  <ctg ctg_no="category no" desc="description2" url_full="url full 2" url_complete="Y" /> 
  </ctg> 
  <ctg ctg_no="category no" desc="description3" url_full="url full 3" url_complete="Y" /> 
 <ctg ctg_no="category no" desc="description4"> 
  <ctg ctg_no="category no" desc="description5" url_full="url full 5" url_complete="Y" /> 
  <ctg ctg_no="category no" desc="description6" url_full="url full 6" url_complete="Y" /> 
 <ctg ctg_no="category no" desc="3rd level"> 
  <ctg ctg_no="category no" desc="3rd level description1" url_full="url full 7" url_complete="Y" /> 
  <ctg ctg_no="category no" desc="3rd level description2" url_full="url full 7" url_complete="Y" /> 
  </ctg> 
  </ctg> 
  </item> 
 <item name="item name 2" item_group="item group 2"> 
  <ctg ctg_no="category no" desc="description8" url_full="url full 8" url_complete="Y" /> 
 <ctg ctg_no="category no" desc="description9"> 
  <ctg ctg_no="category no" desc="description10" url_full="url full 10" url_complete="Y" /> 
  </ctg> 
  <ctg ctg_no="category no" desc="description11" url_full="url full 11" url_complete="Y" /> 
  </item> 
  </kwd> 

My Requirement: 

I need xsl code which will travel through the above nesting and apply the template (for eg <li id = YYYY> </li>). 

template for level one should be like this
<li id = top1>   --- [ added for clarity LEVEL 1 ] 
</li> 

template for level two should be like this
<some thing>
<li id = top2>  --- [ added for clarity LEVEL 2 ] 
</li> 
<something>

template for level three should be like this
<some thing>

<li id = top3> --- [ added for clarity LEVEL 3 ] 
</li> 

<some thing>



Basically the the o/p structure should be like this 
kwd 
   - itemname 1 
       - ctg no description 1  --- [ added for clarity LEVEL 1 ] 
            description 2 
        description 3 
        - ctg no description 4 - --- [ added for clarity LEVEL 2 ] 
             description 5 
             description 6 
            -  ctg no 3rd level   - --- [ added for clarity LEVEL 3 ] 
                  3rd level description 1 
                  3rd level description 2 


Could u Please help. 

thanks in Advance 
Venkatesh 


 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.