Re: mapping attributes.

Subject: Re: mapping attributes.
From: Jamie <jamie@xxxxxxxxxx>
Date: Mon, 6 Nov 2000 17:08:08 -0800
On Mon, Nov 06, 2000 at 07:06:25PM -0500, sara.mitchell@xxxxxxxxx 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!


 XSL-List info and archive:

Current Thread