[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Edit text-nodes with XSLT 2.0

Subject: Re: Edit text-nodes with XSLT 2.0
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 7 Apr 2006 10:53:14 +0100
xslt match priority
On 4/7/06, Beat Pfister <pfister.b@xxxxxxxxxxxxxx> wrote:
> Hi,
>
> I only want to edit the text-nodes of my xml-document, the structure should
> stay as is.
>
> With XSLT 1.0 and Xalan 2.4.1, I used the following templates and it works
> well.
>
>          <xsl:template match="@*|node()">
>            <xsl:copy>
>                   <xsl:apply-templates select="@*|node()"/>
>            </xsl:copy>
>         </xsl:template>
>
>
>          <xsl:template match="text()">          <!-- in the text node the
> replacement of characters with font tags is done-->
>                  <xsl:choose>
>                         <xsl:when test="not(string(.))" />      <!-- test
if
> textcontent is empty -->
>                 <xsl:otherwise>
>                         <xsl:call-template name="find_char1"  >
>                         Some more stuff ...
>                         </xsl:otherwise> <!-- end textcontent is not empty
> -->
>                   </xsl:choose>
>         </xsl:template>
>
> Then I changed to XSLT 2.0 and Saxon 8.6.1 and the templates do not work
any
> more.
> The Error message displayed:
> Recoverable error on line 99 of
> file:/D:/work/ige/fo/26_spa/../Programme/fo/v_0.7/xmltoxml_font.xsl:
>   XTRE0540: Ambiguous rule match for
> /ch-patent-document/bibliographic-data[1]/text()[1]
> Matches both "text()" on line 108 of
>   file:/D:/work/ige/fo/26_spa/../Programme/fo/v_0.7/xmltoxml_font.xsl
> and "node()" on line 98 of
> file:/D:/work/ige/fo/26_spa/../Programme/fo/v_0.7/xmltoxml_font.xsl

It still worked, the error is a recoverable error telling you that two
templates have the same match priority - the recovery action here is
to use the last template in document order, so your output should
still be fine.

If you add a priority attribute to the text() matching template to
give it a higher priority, then you wouldnt get the warning.

cheers
andrew

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.