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

Re: [xsl] Normalizing space / XPTY0004

Subject: Re: [xsl] Normalizing space / XPTY0004
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Jul 2013 13:08:20 -0400

At 2013-07-30 12:53 -0400, Syd Bauman wrote:
Is there some reason not to use

  <xsl:template match="Paragraph[@stylename = 'Body']">
    <xsl:apply-templates select="./TextRun/Text/@value"/>


Not that I can see ... though the "./" is redundant.

What led you to believe this was verboten?

All you are doing is pushing an attribute node at your stylesheet for matching. Note that the built-in template rule for matching an attribute simply adds the content of the attribute to the result tree, so if you don't catch the node with a template match, you may get text in your output you don't want.

I hope this helps.

. . . . . . . . . Ken

-- Public XSLT, XSL-FO, and UBL classes in the Netherlands Oct 2013 | Public XSLT, XSL-FO, UBL and code list classes in Australia Oct 2013 | Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ | G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ profile: https://plus.google.com/116832879756988317389/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal |

Current Thread