Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Question about union operator (|)

From: Joe Kesselman <keshlam-nospam@-------.--->
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent