This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problems with transforming xml with xsl! sample inside


Remember to use an attribute value template in the href attribute, or else it 
will just output the actual XPath expression instead of evaluating it.

<a href="{id(@id)}"><xsl:value-of select="id(@id)/@name"/></a>

and so on (notice the curly-braces).

On Thursday 14 March 2002 05:33, Joerg Heinicke wrote:
> <a href="id(@id)/@value"><xsl:value-of select="id(@id)/@name"/></a>
> </xsl:template>
>
> with keys:
>
> <xsl:key name="links" match="link" use="@id"/>
>
>      <a href="key('links',@id)/@value"><xsl:value-of
> select="key('links',@id)/@name"/></a>
>
> "pure XPATH":
>
>      <a href="/doc/links/link[@id=current()/@id]/@value"><xsl:value-of
> select="/doc/links/link[@id=current()/@id]/@name"/></a>

-- 
Peter Davis
My theology, briefly, is that the universe was dictated but not signed.
		-- Christopher Morley

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]