|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Easy one! variables & documents)
> 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
|
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








