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

RE: XPath count/contains

  • To: "'Svante Schubert'" <Svante.U.Schubert@g...>,"'Tomaz Kastrun'" <tomaz@w...>
  • Subject: RE: XPath count/contains
  • From: "Michael Kay" <mike@s...>
  • Date: Thu, 8 Dec 2005 08:52:34 -0000
  • Cc: <xml-dev@l...>
  • In-reply-to: <43977520.5070408@g...>
  • Thread-index: AcX7iO9eTD18GqcfTouc3c1e0pI+lQASwkzA

xpath count example
> Michael is right Attributes are nodes although the XPATH nodes() 
> function does not match them.

XPath does not have a nodes() function. It's spelt "node()", and it's not a
function.

The NodeTest node() does match attribute nodes. However, if node() is used
as a Step, without specifying an axis, then the axis defaults to the child
axis. So the Step node() will find all nodes (of any kind) on the child
axis. The reason it doesn't find attributes is not that node() doesn't match
attributes, it is that there are no attributes on the child axis. You can
see this if you specify an axis, for example attribute::node(),
self::node(), ancestor-or-self::node() will all match attributes if there
are any attributes on the selected axis. 

Michael Kay
http://www.saxonica.com/




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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.