Re: [xsl] Matching only text nodes with certain (complicated) properties

Subject: Re: [xsl] Matching only text nodes with certain (complicated) properties
From: "David B?rgin" <david.buergin@xxxxxxxxxxxxx>
Date: Fri, 09 Jan 2009 20:56:39 +0100
To all those who've replied,

with your help the original problem has been resolved, thank you!

The template in its (provisional) working form is:

<xsl:template match="body//text()[normalize-space()][preceding::text()[normalize-space()][1] &lt;&lt; preceding::pb[1]]">
<span class="pagenumber">page <xsl:value-of select="preceding::pb[1]/@n"/></span>
<xsl:copy-of select="."/>
</xsl:template>


The matched text node must of course appear in the XHTML. For this purpose I changed the useless <xsl:apply-templates/> instruction to a copy-of instruction (since the matched text node will never contain elements etc.).

Wendell, the whitespace handling is an issue I'm going to consider very soon and I'll think of your strip-space hint, thanks.

David B|rgin

Current Thread