This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Retrieving Full XPATH expression
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Retrieving Full XPATH expression
- From: "Oleg Tkachenko" <olegt at multiconn dot com>
- Date: Sat, 11 Aug 2001 17:38:52 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
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