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

Re: XSL to generate XPaths

Subject: Re: XSL to generate XPaths
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 17 May 2001 15:00:06 +0100
generate xpaths
Hi Michael,

> Here I needed to check if the current node is an element:
>
>   count(.|../*)=count(../*) and count(../*[name()=name(current())]) &gt; 1"
>
> If anyone wants the new version of the whole thing, please let me know.

The easiest way to test whether the current node is an element is
with:

  self::*

This selects the current node if it is an element (with any name); if
a node is selected through this path, then the resultant node set
evaluates as boolean true.
  
(Similarly, you can check whether the current node is a comment with
self::comment(), a text node with self::text() and a processing
instruction with self::processing-instruction().  It's only with
attributes and namespace nodes that you can't use the self:: axis
because they're only accessible through the attribute:: and
namespace:: axes.)

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 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.