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

Re: WARNING org.xml.sax.SAXParseException: The child a

Subject: Re: WARNING org.xml.sax.SAXParseException: The child axis starting at a text node will never select anything
From: "Liam R E Quin liam@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 May 2014 19:31:26 -0000
Re:  WARNING org.xml.sax.SAXParseException: The child a
On Tue, 2014-05-13 at 19:16 +0000, Kulas, Jack jkulas@xxxxxxxxxx wrote:
> I was getting the following warning when I'd run a transformation
> within Arbortext Editor 6.1-F000, which uses the Saxon 9.1.0.5 XSLT
> transformation engine:
> 
> WARNING org.xml.sax.SAXParseException: The child axis starting at a text node will never select anything
> 
> When I replaced this template
> 
>     <xsl:template match="text()" mode="func">
>        <xsl:value-of select="."/>
>         <xsl:apply-templates mode="func"/>
>     </xsl:template>
> 
> with this one
> 
>     <xsl:template match="*" mode="func">
>         <xsl:apply-templates mode="func"/>
>     </xsl:template>

The first template matches text nodes -- text() -- and calls
apply-templates which, in the absence of a select attribute, will be
applied to child elements. However, a text node in XPath cannot contain
elements, so that apply-templates will never do anything.

The second template matches *, which is short for "any element", so it
explicitly does not match text nodes, and elements _can_ contain other
elements of course.

The reason there was no change is presumably because the default
template for text nodes looke a bit like
<xsl:template match="text()">
  <xsl:value-of select="." />
</xsl:template>
which, after you ignore the useless call to apply-templates, is the same
as what you have there. And the template with * is probably not being
called, unless there were elements in your document that no other
template matched.

Liam


-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

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.