ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error

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

RE: Test for node name and attribute value

Subject: RE: Test for node name and attribute value
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Tue, 30 Nov 2004 11:59:20 +0000
xsl test name
From: "Robert Soesemann" <rsoesemann@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  Test for node name and attribute value
Date: Tue, 30 Nov 2004 12:51:53 +0100

Hello

I am stuck with the following node set expression.
In an external document I want to find the element which name is
'anchor' and which attribute @name has the value
of the variable $anchor.

I tried the following expression:

  ...
1 <xsl:for-each ...>
  ...
2 <xsl:variable name="anchor" select="@anchor"/>
3 <xsl:variable name="anchor-node" select="$external-doc//node()[name()
= 'my-anchor' and @name = $anchor]" />
  ...
4 </xsl:for-each>

--

By the way can remove line 2 and just rewrite line 3 to...?

3 <xsl:variable name="anchor-node" select="$external-doc//node()[name()
= 'my-anchor' and @name = @anchor]" />

Best regards,

Robert

Looks fine except that you said r=the name was "anchor" in the first bit but you are testing against "my-anchor" in the second paart, you can also, I believe, just search elements instead of all nodes by using:
select="$external-doc//*[name() = 'my-anchor' and @name = @anchor]"


--

Joe

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.