[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Is this an XPath Grammar Limitation ?
> 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|