I had left out an important part of the problem before. The elements are within elements, and we want to match a sequence that is split between two elements, but not between two elements (common grandparent needed, but different parents OK).
Michael Dyck suggested another approach on the XQuery list, where the query would look something like this (simplified here to a 2-note query):
{FOR $x in document(“frere-jacques.xml”),
$note1 IN $x//note[.=“C”],
$part IN $note1/ancestor::part,
$note2 IN $note1/following::note[1][.=“D”][./ancestor::part == $part]
RETURN
{$note1 $note2}
}
This looks promising, but I cannot get this to run in QuiP. I get a message “The kind must be one of the constants!” It looks like the problem occurs when using the ancestor:: axis.
Is this XPath axis supported in QuiP? There is a comment in the XQuery working draft that XQuery might not support all XPath axes, and/or may not support both the full and abbreviated syntax. How might we register that it is indeed very important for XQuery to be compatibile with XPath in this respect? Aside from the namespace axis, I am quite sure we are using all the XPath axes in our existing DOM code and would definitely want to use them in our XQuery code.
Thanks again for the help!
Michael Good
Recordare
[This message was edited by good on 10 Aug 2001 at 00:34.]