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

Re: Easy one! variables & documents)

Subject: Re: Easy one! variables & documents)
From: david_n_bertoni@xxxxxxxxxx
Date: Wed, 30 Apr 2003 16:05:55 -0700
td easy



> Okay, I got that.
> Now I am having trouble... I need to select from this external doc the
value
> of one of the nodes.  So, I'm within the context of another template, and
> from this template there is an attribute @Name, who's value will match
one
> of the values from the external doc.  I'm trying to get the @Text value
from
> the external doc where the @Name matches in both.  So:
>
>      <xsl:for-each select="@*">
>         <tr>
>         <td><!-- lookup text for display in xml template -->
>         <xsl:value-of select="$xmTmplt/[@name=name()]/text"/>
>         </td>
>
> ...  doesn't work : (

As I said previously, you're really not giving us enough to understand your
problem.  What does "doesn't work" mean, and what does this mysterious
document look like?

> <xsl:value-of select="$xmTmplt/[@name=name()]/text"/>

This is not a valid XPath expression, because there's no node test in the
second step.  Does the FLD element have an attribute called name?  If so,
then may be you meant this:

   "$xmTmplt[@name=name()]/text"

And what are you expecting to get back from the call to the name()
function?  Is it the attribute name in the outer xsl:for-each instruction?
If so, you need to do something like this:

   <xsl:for-each select="@*">
      <xsl:variable name="outer" select="current()"/>
      <tr>
      <td><!-- lookup text for display in xml template -->
      <xsl:value-of select="$xmTmplt[@name=name($outer)]/text"/>
      </td>
   </xsl:for-each>

Dave


 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.