-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about xpath // #26
Comments
Two differences:
I think that the two definitions are functionally equivalent though. Can you find an example of an XPath match for |
So I've managed to draw up a test example illustrating the issue. Sample xml:
The goal is to find all elements that have an The below two xpath searches are identical, as per the aforementioned definitions of
returns
The below xpath search DOES note the
returns
I'm sure most of the time, this is just theoretical, but this is a specific instance where it affected one of my queries. I agree thinking of |
Interestingly, this looks like it has just proved that when you want So while I have no doubt the XQH definition is correct, it doesn't look like ours is wrong after all… |
I think I realized what the problem was, from p.53 of the Walmsley XQuery book (which also gave the same node definition for Whenever you type the name of an element after a So I think anyways. |
So at 11:42 of "Advanced Digital Editing: Introduction to XPath II", it says
./descendent::head
is the same as//head
which I do find to be the case. But in the book XQuery for Humanists (p.62) it saysA double slash (//) stands for /descendant-or-self::node()/
.I know from having debugged a problematic query that
/descendant-or-self::node()/head
is not the same as/descendent-or-self::head
(particularly when it comes to looking for attributes within/head
which I think are technically siblings, not descendents), but I don't know why, especially since functionally it seems to just make // equivalent to, as mentioned in the video,./descendent::head
.Can you possibly explain the difference between the two definitions (yours and XQH's) for // ?
The text was updated successfully, but these errors were encountered: