|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Singling Out Nodes in Look-up Table
Hi Chuck,
> I can get close with the key I'm using, which gives me the node set
> I'm after, but I really need to map each node within that set, so
> that instead of this statement:
>
> <xsl:value-of select="$lookup/@id"/>
>
> getting only the first node of the node set, I need a better
> statement that iterates through the set. An apply-templates gets me
> the whole set, instead of individual nodes, which makes sense to me.
> These are truncated source docs -- the full docs would reveal that
> the key exposes large node sets consisting of several id="xxxxxx"
> attribute value pairs.
I think I'm missing something about what you're trying to do. Can't
you either use xsl:for-each:
<xsl:for-each select="$lookup">
<xsl:value-of select="@id" />
<xsl:text>
</xsl:text>
</xsl:for-each>
or xsl:apply-templates:
<xsl:apply-templates select="$lookup" />
with a template matching row elements:
<xsl:template match="row">
<xsl:value-of select="@id" />
<xsl:text>
</xsl:text>
</xsl:template>
By the way, since what you actually want to get are the field elements
whose name is 'Position', based on their value, a better key might be:
<xsl:key name="lookup" match="field[@name = 'Position']" use="."/>
Then instead of using:
<xsl:variable name="lookup"
select="key('lookup', $position)/field[@name='Position']"/>
You could just do:
<xsl:variable name="lookup" select="key('lookup', $position)" />
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
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








