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

RE: Retrieving Full XPATH expression

Subject: RE: Retrieving Full XPATH expression
From: "Oleg Tkachenko" <olegt@xxxxxxxxxxxxx>
Date: Sat, 11 Aug 2001 17:38:52 +0200
retrieving full xpath expression
Hello Tom !

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Tom Landon
> Sent: Friday, August 10, 2001 8:51 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Retrieving Full XPATH expression
> 
> 
> This is not exactly what you need, but it might be a good starting point:

>         <!-- Attribute node (test if node is in set of parent's
> attributes) -->
>         <xsl:when test="$node = $node/../@*">

Do you realize that this conditional statement can surprisingly evaluate to true for some element node either ? 
An operator "=" applyed to nodes doesn't test one operand to be the same as another one, it compares their string values instead.
For example, above test will be true for <Book> element:

<Books attr="value" >
	<Book>value</Book>
</Books>

It's a little artificial example, but anyway I don't think it's a good way to detect attribute node type, instead you can use one of thje following approaches : count(. | ../@*) = count(../@*) or generate-id() = generate-id(../@*[name()=name(current())]).

---
Oleg Tkachenko,
Multiconn International 


 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.