Subject: Re: Attribute value templates
From: "Amit Rekhi" <amitr@xxxxxxxxxxxxx>
Date: Tue, 27 Oct 1998 10:43:33 +0530
|
Hi! Anders,
>than one elements in the input doc we must select node (on attribute
>value) and value in a single attribute value template.
>
>Is this possible?
Yes it is.
Pl. correct me if I'm wrong , since I'm still new to the XSL world :-)
The original XML file :-
<example>
<color name="red" rgb="ff0000"/>
<color name="green" rgb="00ff00"/>
<color name="blue" rgb="0000ff"/>
</example>
The XSL stylesheet :-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="example">
<circle bg="{color[attribute(name)='green']/attribute(rgb)}"
fg="{color[attribute(name)='blue']/attribute(rgb)}"/>
</xsl:template>
</xsl:stylesheet>
Why don't you also look at the XSL spec. section 2.7.2.
It may help
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|