![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Nest transform results differently than nested XML elements Nest transform results differently than nested XML elementsTo: NULL Date: 8/22/2007 5:22:00 PM I'm new to XSLT and have been banging my head against a wall trying to produce the results I want. I'm hoping that it's blatantly obvious to someone here who can point me in the right direction. My XML is as follows: ========= <menu> <page name="Product" url="view.aspx"> <page name="View" url="view.aspx" /> <page name="Modify" url="modify.aspx" /> <page name="Pricing" url="pricing.aspx"> <page name="Lot" url="lot.aspx" /> <page name="Sample Pricing" url="sample.aspx" /> <page name="Special Customer" url="special.aspx" /> </page> <page name="Sales" url="sales.aspx"> <page name="General" url="sales.aspx"> <page name="Sales Tools" url="sales_tool.aspx" /> </page> <page name="Vendor" url="vendor.aspx" > </page> <page name="Complaint" url="complaint.aspx?catID=-1"/> <page name="Reports" url="reports.aspx"> <page name="Report List" url="reports.aspx" alwayslink="true"/> </page> </menu> ========== I'd like to produce is the following under each example circumstance: When I apply a template to the element with name "Lot", I'd like to see: <div> Product | Complaint | Reports </div> <div> View | Modify | Pricing | Sales | Vendor </div> <div> Lot | Sample Pricing | Special Customer </div> When I apply a template to the element with name "Complaint", I'd like to see only: <div> Product | Complaint | Reports </div> So basically, for a given selected XSL element, I'd like a <div> that contains attributes of the selected element's greatest ancestor and its siblings, followed by the same for it's next greatest ancestor, and so on, ending with a <div> that contains attributes of the selected element and it's siblings. I'm not quite sure how to approach a case like this, where the result elements are nested differently than the XML elements. Can someone point me in the right direction? I should note that the XML can be changed if necessary - I just organized to resemble the navigation hierarchy. Thanks, Joe | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
