-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Namespace-Problem following/following-sibling #3404
Comments
@lmaylein I am not able to reproduce the problem in your report. The conditional statement evaluates as true in the following query, returning "found it!": xquery version "3.1";
declare namespace tei="http://www.tei-c.org/ns/1.0";
let $doc :=
document {
<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:hei="https://digi.ub.uni-heidelberg.de/schema/tei/heiEDITIONS">
<milestone ana="hc:Chapter" n="5" xml:id="H_ep5" spanTo="#end.H_ep5"/>
<milestone ana="hc:Heading" resp="hc:Editor" xml:lang="en" spanTo="#end.head.H_ep5.en"/>Tiberius<anchor xml:id="end.head.H_ep5.en"/>
<milestone ana="hc:Heading" resp="hc:Editor" xml:lang="de" spanTo="#end.head.H_ep5.de"/>Tiberius<anchor xml:id="end.head.H_ep5.de"/>
</TEI>
}
let $node := $doc/tei:TEI//text()[1]
return
if ($node/following::tei:anchor[@xml:id=substring($node/preceding::tei:milestone[@resp='hc:Editor'][1]/@spanTo,2)]) then
"found it!"
else
"didn't find it :(" Can you provide a self-contained query like this that demonstrates the problem? |
Yes, I am no longer sure that this is really a namespace problem. I tried to extract a self-contained example from the complex application. In doing so I came across the following problem, which may be related to my original problem. I may also have misunderstood xpath here. Here is my self-contained and simplified query:
This produces:
But in my opinion the result should be the following.
If I change the if condition to
every thing works as expected. |
I've checked the behavior of @lmaylein's self-contained query in two different processors out of Oxygen. The built-in Saxon-HE XQuery 9.8.0.12 processor gives this (correct) result:
But if processed by the eXist-db (5.2) XQuery engine the result is:
The eXist-db XQuery engine seems to have a problem dealing with a predicate on the "following" axis correctly, or am I wrong? |
Given XML file:
The following if-condition is not recognized as fulfilled for the two text-nodex "Tiberius":
If I remove the (default) tei namespace, the if-condition is recognized as fulfilled (as it should be).
But this is unfortunately very slow, because no indexes can be used.
or
Same problem if I use following-sibling instead of following.
Context (please always complete the following information):
The text was updated successfully, but these errors were encountered: