Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XPath filters equivalence

From: Joe Kesselman <keshlam-nospam@-------.--->
To: NULL
Date: 10/6/2007 7:28:00 AM

Altu wrote:
> Is [p1][p2][p3] the same as [p1 AND p2 and p3] in XPath?

Depends on the predicate. If p2 or p3 tests position() or last(), _NO_ 
-- the latter form would test position in the original set, while the 
former would test position in the set that has gotten past the 
preceeding filter(s).

> Also if I have a predicate that starts with "/" or "//", does it
> matter where in the XPath expression it is?
> /a[/a/b]/c/d
> /a/c[/a/b]/d
> /a/c/d[/a/b]

In these examples: no, since an absolute XPath by definition ignores its 
context and since if it fails in any of these the result is that we find 
no nodes. (Though for performance reasons in typical processors, you 
will probably want to test it earlier rather than later).

In more complicated XPaths, maybe.


-- 
() ASCII Ribbon Campaign  | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry


transparent
Print
Mail
Digg
delicious
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