Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Question about union operator (|) >Thread Next - Re: Question about union operator (|) Re: Question about union operator (|)To: NULL Date: 9/2/2007 10:59:00 PM Richard Tobin wrote: > I'm not sure I understand your description, but if you mean "why is it > defined as descendant-or-self::node()/ rather than descendant::", it's > so that expressions like //p[1] mean "all paragraphs that are first > children" rather than "the first paragraph". I presume you mean "all paragraphs that are the first paragraph". I can see where that argument might have been advanced. But all our experience with the rest of the XPath expression language leads us to expect it to mean the latter. Convenience needs to be balanced against principle of least surprise, and I believe the d-or-s::node() expansion of // violates that principle. If they wanted to provide a shorthand for this purpose, fine, but they should also have provided a shorthand for descendant, to help keep the two from getting confused. Too late to fix now; it is what it is. But I still put it in the category of "warts to be fixed someday." -- () ASCII Ribbon Campaign | Joe Kesselman /\ Stamp out HTML e-mail! | System architexture and kinetic poetry | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
