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

RE: Is this an XPath Grammar Limitation ?

Subject: RE: Is this an XPath Grammar Limitation ?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 11 Feb 2005 10:59:12 -0000
xpat runtime error
> Michael Kay wrote:
> 
> > Here are some expressions that the 1.0 syntax allows
> > but the data typing rules prohibit:
> > 
> > 1/fred
> > 
> > fred/1
> > 
> > count(3)
> > 
> > 4 | 5
> 
> Turns out Jaxen was flaking out on half of those (returning 
> empty lists 
> instead of throwing an exception). I've now fixed them. Are there any 
> other kinds of BNF-correct but datatype-forbidden expressions 
> in XPath 
> 1.0 I should be watching out for?

XPath 1.0 is generally designed to be free of run-time errors - i.e. if you
make a mistake it returns garbage rather than reporting an error. The only
type conversion it won't attempt is converting an atomic value (in 2.0
parlance) to a node-set. The above examples all exploit this: they are all
functions/operators that expect a node-set but are given an atomic value. I
can't offhand think of any others, except simple variations like replacing
count() by sum().

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

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.