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

Re: Matching text nodes

Subject: Re: Matching text nodes
From: "Steve Muench" <Steve.Muench@xxxxxxxxxx>
Date: Tue, 26 Dec 2000 09:36:19 -0800
matching text
|   <xsl:template match="text()" >
| 
| nothing is matched, but when i do this in this way 
| ( AFAIK this does the same )
| 
|   <xsl:template match="*/text()" >
| 
| evrything is ok, i can understand why second works , but why first not ?
| 
| FYI i'm using Oracle 2.0.9 parser in W2k..


Hard to say without seeing the rest of your stylesheet's
templates, but I'm going to guess that you have the
following situation going on...

You probably have:

  <xsl:template match="text()">

then later in the stylesheet:

  <xsl:template match="node()|@*">

with an identity transformation template.

Since match="text()" has the same priority as
match="node()", and since both text() and node()
match a text node, the match="node()" will fire
instead of the match="text()" since it occurs
later in document order in the stylesheet. By your
changing the match pattern to match="*/text()"
this becomes more specific than match="node()" so
this causes your match="*/text()" rule to "get noticed"
by the XSLT engine where it previously was being ignored.

The solution is to change your template to have
an explicit priority like this:

   <xsl:template match="text()" priority="2">

which makes it take priority over the match="node()"
template.

______________________________________________________________
Steve Muench, Lead XML Evangelist & Consulting Product Manager
BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
Author "Building Oracle XML Applications", O'Reilly
http://www.oreilly.com/catalog/orxmlapp/





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.