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

Re: xpath not..

Subject: Re: xpath not..
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 21 Nov 2000 09:24:56 GMT
xpath not element
> (or is my link http://www.w3.org/TR/xpath.html outdated ?)

probably not:)

> . and i still cant find sth like not(self::*) there...
> ...
>  and for some reasons you need the inner brackets 

You need the inner brackets because not() is a function and xpath
functions _always_ have () around their arguments.

          3.2 Function Calls

          A FunctionCall expression is evaluated by using the
          FunctionName to identify a function in the expression
          evaluation context function library, evaluating each of the
          Arguments, converting each argument to the type required by
          the function, and finally calling the function, passing it the
          converted arguments. It is an error if the number of arguments
          is wrong or if an argument cannot be converted to the required
          type. The result of the FunctionCall expression is the result
          returned by the function.

          An argument is converted to type string as if by calling the
          string function. An argument is converted to type number as if
          by calling the number function. An argument is converted to
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          type boolean as if by calling the boolean function. An
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          argument that is not of type node-set cannot be converted to a
          node-set.

           [16] FunctionCall ::=  FunctionName '(' ( Argument ( ',' Argument )* )? ')'
                                                ^                                   ^
                                                ^                                   ^
                                                ^                                   ^
So that says the syntax is not(  ) and self::* is allowed as an argument
as that selects a node set, so by the paragraph above it is allowed in
the argument of not() if it may be converted to type boolean by the
boolean() function.

may provide additional functions for case conversion.

          4.3 Boolean Functions

          Function: boolean boolean(object) 

          The boolean function converts its argument to a boolean as follows:

                a number is true if and only if it is neither positive
                or negative zero nor NaN

                a node-set is true if and only if it is non-empty

                a string is true if and only if its length is non-zero

                an object of a type other than the four basic types is
                converted to a boolean in a way that is dependent on
                that type



so in a boolean context self::* is true if and only if the node set
selected is non empty which is true if and only if the current node is
an element, so not(self::*) is true just if the current node is not an
element.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp


 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.