If you are allowed to share some snippets of the actual documents, it will be easier to see how the query needs to be phrased.

Have you verified that $biblFull and $biblStruct actually contain strings? If not, do you need to declare a default namespace? The vocabulary looks like TEI, so

declare default element namespace "http://www.tei-c.org/ns/1.0";;

may be necessary. And if it is TEI, the ID attributes are probably called @xml:id rather than @id.

Gerrit

On 26.03.2019 00:18, Chris Yocum wrote:
Hi Gerrit,

Are you sure that the @target attributes are supposed to be identical to the
IDs?

Yes, they should be.  If they are not, I need to find them so I can
fix them to be identical.

Don’t you prepend a pound sign to @target attributes when they point to
IDs within the same document?

They are not in the same document.  The @target attributes live spread
out in the other documents while the IDs all live in the same
document.

So you probably need to say

where not(substring($title/@target,2) = $biblStruct) and
not(substring($title/@target,2) = $biblFull)


I will give this a shot tomorrow when I am not as tired.

And maybe you need to restrict the titles that you search to those with a
@target attribute, like so:

for $title in collection('edil_target/eDIL-A.xml')//entry//title[@target]


This is the other half of the problem which I did not state here. I am
to find all titles that do not have target attributes then give them a
target attribute based on some rules.  I have done so in a few files
(and I explicitly testing one of them in the query in my previous
email) and I will roll out the fix in all other files once I have
everything else tested and working.

I will give your suggestion a try tomorrow. Thanks!

All the best,
Chris


Reply via email to