[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: lookup table
Subject: Re: lookup table
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Tue, 23 Jul 2002 20:34:37 +0200
|
> What you probably want is "term[@name = current()/name()]".
Sorry, it has to be "term[@name = name(current())]".
Joerg
Joerg Heinicke wrote:
> select="document('')/*/data:definitions/term[@name = name()]"
Both @name and name() refer to the term element, so it's true for:
<term name="term"/>
What you probably want is "term[@name = current()/name()]".
Regards,
Joerg
Guy McArthur wrote:
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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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
RSS 2.0 |
|
Atom 0.3 |
|
|