This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Retrieving Full XPATH expression


Hello Tom !

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com 
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Tom Landon
> Sent: Friday, August 10, 2001 8:51 PM
> To: xsl-list@lists.mulberrytech.com
> Subject: RE: [xsl] 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]