Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Nest transform results differently than nested XML elements

From: joe.hodsdon@-----.---
To: 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



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent