Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Question about union operator (|)

From: richard@------.--.--.-- (------- -----)
To: NULL
Date: 9/2/2007 9:38:00 PM

In article <D6adnVtO6Od7U0fbnZ2dnUVZ_jSdnZ2d@c...>,
Joe Kesselman  <keshlam-nospam@c...> wrote:

>By the way, if you're implementing XPath, watch out for the definition 
>of //. (I'm still trying to find someone who can explain to me why this 
>operation was explicitly defined as a top-down scan rather than as a 
>traditional postorder tree walk. Both are perfectly reasonable 
>operations, but I would expect the latter to be more commonly used and 
>hence a better meaning for the shorthand // operator. And having to 
>constantly remind folks that it *isn't* just document-ordered 
>descendant:: has been an ongoing nuisance.)

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 believe this was
considered more common in formatting, and practical to implement as a
match pattern (predicates in match patterns can only occur after
child:: or attribute:: steps, so position() only requires examination
of siblings, rather than the whole tree).

-- Richard


-- 
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.


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