- From: Michael Good <good@recordare.com>
- Date: Wed, 18 Jul 2001 00:17:02 -0700
- To: "'Michael Dyck'" <MichaelDyck@home.com>
- Cc: <www-ql@w3.org>
Hello Michael, Thank you for letting me elaborate the problem - I left out an important aspect. We want to match <part name="voice"> <measure number="1"> <rest/> <rest/> <note>C</note> <note>D</note> </measure> <measure number="2"> <note>E</note> <note>C</note> <rest/> <rest/> </measure> </part> But not <part name="voice"> <measure number="120"> <rest/> <rest/> <note>C</note> <note>D</note> </measure> </part> <part name="piano"> <measure number="1"> <note>E</note> <note>C</note> <rest/> <rest/> </measure> </part> So I don't think the following::note XPath will work to exclude the latter example. Sorry I did not include that aspect in my original problem. This motivated the general request to restrict the sequence to a certain level of ancestor - in this case, we a common grandparent - a common parent is too restrictive, a common great-grandparent too general. And we do need all four notes, because things get more complicated quickly. In general, we will need to do a fuzzy search and rank the results for relevance. But for now, I will be happy with something simple for exact searches that does not give false positives. Thanks again, Michael Good Recordare -------------------- Michael Dyck wrote: Hmmm... How about this XPath: //note[.="C" and following::note[1]="D" and following::note[2]="E" and following::note[3]="C"] That would select the first note of each occurrence of the "Frere Jacques" melody in the current document. If (as you say) you want to select all four notes of each occurrence of the melody, that would be more involved, I think.
Received on Wednesday, 18 July 2001 03:15:50 UTC