|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: lookup table
> > Can I have a static lookup table *inside* my xsl stylesheet?
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:data="urn:some.urn"
> exclude-result-prefixes="data">
>
> <data:definitions>
> <term name="gmt">Greenwich Mean Time</term>
> <term name="mst">Mountain Standard Time</term>
> </data:definitions>
>
> <xsl:template>
> <xsl:value-of select="document('')/*/data:definitions[@name='gmt']"/>
> </xsl:template>
> ...
>
What I'm doing is
select="document('')/*/data:definitions/term[@name = name()]"
(where the attribute matches the node name).
The input is like:
<times>
<mst>some time value</mst>
<utc>another time value</utc>
</times>
But it doesn't work! Everything else is as you suggested.
Are @name and name() comparable as strings?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








