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

RE: XSLT test on the name of a node

Subject: RE: XSLT test on the name of a node
From: "Tim Watts" <timw@xxxxxxx>
Date: Mon, 25 Mar 2002 17:28:19 +1100
xsl test tag name select
Hi Joerg,

> > <xsl:variable name="translation" select="$language/node()[local-name() = @ld-tag]" />

> I think the problem is in the above code.
> You are selecting nodes, whose local name is the same as the value of their ld-tag 
> attribute. What you probably want to have is current()/@ld-tag:

> <xsl:variable name="translation" select="$language/node()[local-name() = current()/@ld-tag]" />

I don't understand what makes it different when using current(), although you were right.  The template now works.

I thought by using the template matches I was comparing with the context nodes @ld-tag and I can't quite understand the difference.

> Furthermore node() is a superset of *. node() = * + text() + comment() +
> processing-instruction().

Thanks for that.  You're giving me quite an education! :)

I have included the template as it now stands below.  Could you explain how the current() works with it?

Thanks for all your help.

Tim Watts


<!-- template called to display method -->
<xsl:template name="get_payment_method_details">
<xsl:variable name="paymentsystems" select="document('../paymentsystems.xml')/root" />
<xsl:variable name="merch_pay_details"><xsl:copy-of select="/document/data/merchant/payment" /></xsl:variable>
  <xsl:apply-templates select="$paymentsystems/methods/method[@id=$pmethod]">
    <xsl:with-param name="merch_pay_details" select="$merch_pay_details" />
  </xsl:apply-templates>
</xsl:template>

<xsl:template match="method">
<xsl:param name="merch_pay_details" />
  <xsl:apply-templates select="input" mode="getinfo">
    <xsl:with-param name="merch_pay_details" select="$merch_pay_details" />
  </xsl:apply-templates>
</xsl:template>

<xsl:template match="input" mode="getinfo">
<xsl:param name="merch_pay_details" />
  <tr>
    <td>
      <xsl:value-of select="$language/*[local-name() = current()/@ld-tag]" />
    </td>
    <td>
      <input type="text" name="{concat('payment/', @name)}" />
    </td>
  </tr>
</xsl:template> 

 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.