This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: mapping attributes.
On Mon, Nov 06, 2000 at 07:06:25PM -0500, sara.mitchell@ps.ge.com wrote:
> I think I understand what you want, but the code you're showing
> doesn't seem to match.
You're right, it doesn't match. (I was trying to save the list of a larger
XML document, most being irrelevant)
> What I think you want is to generate
> the cross-reference where the <RELATED> element occurs and have the
> generated link contain the text of the title for the targeted
> SECTION (based on matching the value of the ID attributes).
>
> If that is what you want, something like this ought to work:
>
> <xsl:template match="RELATED">
> <xsl:variable name="target" select="@ID"/>
> <A HREF="#{@ID}>
> <xsl:value-of select="//SECTION[@ID=$target]/TITLE"/>
> </A>
> </xsl:template>
A variant of this worked! Thanks to both who responded, I guess the trick was
in the variable. (I had thought variables needed to be evaluated in {}'s
which didn't seem work in Sablotron.)
Anyhow, the <xsl:variable name="target" select="@ID"/> was the "ah-hah!" in
this case. Thank you very much!
Jamie
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list