RE: testing node type

Subject: RE: testing node type
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Fri, 22 Sep 2000 12:01:48 -0400 (EST)
At 22 Sep 2000 14:25 +0100, Pawson, David wrote:
 > Linda van den Brink
 > 
 > comment() and processing-instruction()
 > 
 > > As I understand these are not functions but Node Tests, part of XPath.
 > > Mentioned in chapter 6 of XSLT Programmer's reference, and defined in
 > > section 2.3 of XPath. 
 > 
 > Herrumphh. They look like functions to me!
 > *and* they are not in the index! 
 > 
 > (page 372, well buried). Indexed as node test. Sigh.
 > And DC thinks he gets it wrong occasionally ;-)
 > 
 > Thanks Linda.
 > 
 > New 'bit' for the reference card Tony?

No.  Look under the heading "Node Tests [XPath 2.3]".

They look like functions but they're not.  XPath section 3.2, Function
Calls, has:

[16]  FunctionCall ::= FunctionName '(' ( Argument ( ',' Argument )* ) ')'

but section 3.7, Lexical Structure, has:

[35]  FunctionName ::= QName - NodeType

and

[38]  NodeType     ::= 'comment'
                       | 'text'
                       | 'processing-instruction'
                       | 'node'

So the node type node tests look like function calls but they're not
because their names are explicitly not allowed as function calls.

Regards,


Tony Graham
======================================================================
Tony Graham                            mailto:tgraham@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9632
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread