[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Error: Ambiguous


Subject: Re: [xsl] Error: Ambiguous
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 15 Jul 2008 09:50:55 +0100

> I got ambiguous error when match the below,
>
> XSL:
> <xsl:template
> match="subsection[@level='1']><sec1><xsl:apply-templates/></sec1></xsl:templ
> ate>
>
> <xsl:template match="subsection[@type='references']"><cits
> style="numero"><xsl:apply-templates/></cits></xsl:template>
>
> XML:
> <subsection id="ss1" level="1" type="introduction">
> <subsection id="ss2" level="1">
> <subsection id="ss2-1" level="2">
> <subsection level="1" id="ss11" type="references">
>
> If the element subsection contains the attribute value, type="reference", I
> have to match using <cite..> see above.
>
> All other matches, is <sec1> as mentioned above.

Modify one or both match patterns to be:

<xsl:template match="subsection[@level='1'][not(@type='references')]">

and

<xsl:template match="subsection[@type='references']" priority="2">

When @type = 'references' that template will win, otherwise it will be
the @level = '1' matching template.


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/


Current Thread