xsl-list
[Top] [All Lists]

[xsl] request for help resolving ambiguous rule match

2008-11-24 11:04:02
Hello all,

In my xml (TEI P5 documents), I have structures like this:

<lg xml:id="d1e45" n="II">
        <l xml:id="d1e47" n="9">
                <q next="#d1e53" prev="#d1e37" xml:id="d1e49">
                        Lo, thou hast broken the sweet yoke</q>
        </l>
        <l xml:id="d1e52" rendition="#ti-1" n="10">
                <q next="#d1e57" prev="#d1e49" xml:id="d1e53">
                        That my high beauty held above</q>
        </l>
        <l xml:id="d1e56" n="11">
                <q next="#d1e61" prev="#d1e53" xml:id="d1e57">
                        All priests and clerks and merchant-folk;</q>
        </l>
        <l xml:id="d1e60" rendition="#ti-1" n="12">
                <q next="#d1e65" prev="#d1e57" xml:id="d1e61">
                        There was not one but for my love</q>
        </l>
        <l xml:id="d1e64" rendition="#ti-1" n="13">
                <q next="#d1e70" prev="#d1e61" xml:id="d1e65">
                        Would give me gold and gold enough,</q>
        </l>
        <l xml:id="d1e69" n="14">
                <q next="#d1e74" prev="#d1e65" xml:id="d1e70">
                        Though sorrow his very heart had riven,</q>
        </l>
        <l xml:id="d1e73" rendition="#ti-1" n="15">
                <q next="#d1e78" prev="#d1e70" xml:id="d1e74">
                        To win from me such wage thereof</q>
        </l>
        <l xml:id="d1e77" n="16">
                <q next="#d1e88" prev="#d1e74" xml:id="d1e78">
                        As now no thief would take if given.</q>
        </l>
</lg>

The above represents a stanza <lg> with lines of verse <l> that contain quotes <q> that extend over the hierarchy of the lines. I want to match the <q> children (with both @next and @prev) of the first line <l> of a stanza <lg>.

Something like this works: <xsl:template match="lg/l[position() = 1]/ q[(_at_)next and @prev]"/>

But I also have (and need) a template that simply matches "q[(_at_)next and @prev]", so my processor (Saxon9b) is throwing a warning about an ambiguous rule match, with ambiguity between "lg/l[position() = 1]/ q[(_at_)next and @prev]" and "q[(_at_)next and @prev]".

So my question … Can someone please help me out with another way to express "lg/l[position() = 1]/q[(_at_)next and @prev]" that will resolve the ambiguity?

Thank you so much.

John
--
| John A. Walsh, Assistant Professor, School of Library and Information Science
| Indiana University, 1320 East Tenth Street, Bloomington, IN 47405
| www: <http://www.slis.indiana.edu/faculty/jawalsh/>
| Voice:812-856-0707 Fax:812-856-2062 <mailto:jawalsh(_at_)indiana(_dot_)edu>




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>