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

Selecting an element by a dynamic attribute value

Subject: Selecting an element by a dynamic attribute value
From: "Rupert Parson" <rupert.parson@xxxxxxxxxxxxxxxxx>
Date: Tue, 24 Jan 2006 12:06:29 -0000
rupert parson
Dear all,

I have an XML file which looks something like this:

--------------------------------------------------------------

<results>
	<graphs>
		<graph label="foo" file="graph0.gif"/>
		<graph label="bar" file="graph1.gif"/>
		<graph .... etc />
	</graphs>

	<data>
		<run label="foo">
			<some data elements>
			</some data elements>
		</run>
		<run label="bar">
			<some data elements>
			</some data elements>
		</run>
	</data>
</results>

---------------------------------------------------------------

For irritating reasons, the graphs part and the data part are produced by
two different pieces of code, so can't be combined (the file attribute of
<graph> elements can't be inserted into the <run> elements in the xml file).

I would like to render this using xsl. I have up to now just been rendering
the <data> element in the xml file, using an <xsl:for-each> to loop around
the <run> elements.

I would like to insert into each of the <run> element renderings an html
<img> element. This <img> element would have an href attribute being the
value of the file attribute of the <graph> element with matching label (i.e.
the same label attribute value as the <run> element I am currently
rendering). Is there any way to do this?

Many thanks in advance for your help,

Rupert Parson

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.