|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Handling of "error value" in XPATH 2.0
[Joe English] > > Thomas B. Passin wrote: > > > > I also noticed something else [in XPATH 2.0] > > and I'd like some assurance that it isn't a problem, or else that it > > will be handled. > > > > I'm referring to "error value", which will sometimes be returned by XPATH > > 2.0 expressions. I haven't found any place in the draft that says anything > > about how the "error value" is to be handled. > > The use of a distinguished "error value" is a fairly common > technique in formal semantics; it's used to simplify the definitions. > > In the XPATH 2.0 rec, it says: > > | _Error_ is a special value indicating that an error has been > | encountered during the evaluation of an expression. Except > | as noted in this document, if any operand of an expression > | is the error value, the value of the expression is also the > | error value. [2.1 "Basics"] > Aha! I thought I had found every occurrence of "error value", but I must have had the 1000-yard stare when I got to that one. > The "Except as noted in this document" clause is the important > part. The rest of the spec lists several places where the error > value may be introduced, but it rarely needs to specify how it's > handled, because that's covered by this one paragraph. This > shortens the spec considerably. > > Consider for example 2.5 "Arithmetic Expressions", where there are > four clauses specfying how an arithmetic expression is evaluated. > This would easily be twice as long if it explicitly accounted for > errors at each step. (By way of contrast, check out the ECMAScript > standard; nearly every clause in that spec is mostly boilerplate text > which redescribes how errors are handled.) > > I'm very comfortable with referring to a clause rather than repeating the boilerplate. I just want to make sure that it's easy to test for, and that how we test for error_value won't vary between implementations (like getting the string "NaN" - you know what to look for). Cheers, Tom P
|
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
|
|||||||||

Cart








