[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Singling Out Nodes in Look-up Table

Subject: Re: Singling Out Nodes in Look-up Table
From: Chuck White <chuckwh@xxxxxxxxxxx>
Date: Tue, 15 Jan 2002 08:36:20 -0800
look up table asm
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>&#xA;</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>&#xA;</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>&#xA;</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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.