This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Singling Out Nodes in Look-up Table
Thanks, Jeni:
When I tried apply-templates, I got
ASM, ------ The ID# for this position is IDAHBMIBIDABEMIBIDAXDMIB
and I needed to single each id out with a statement that said (for example):
ASM...The ID# for this position is...IDAHBMIB
*That* is where I missed the obvious, though, and your including the
<xsl:text>
</xsl:text> in the for-each statement kicked the party goers
out of my head. I had tried for-each repeatedly, using different template
manipulations, when my problem all along was that I wasn't writing the other
part of the result using the correct template. Kind of a big "duh", but I
knew that when I posted.
I'm sure you're right about the key. I've done about 50 versions trying to
get at the solution, so the one I showed was just my most recent.
Anyway, thanks for taking the time to look at the lengthy code!
regards,
chuck white
> 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
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list