Re: [xsl] What to use instead of xsl:value-of

Subject: Re: [xsl] What to use instead of xsl:value-of
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Tue, 06 May 2008 10:04:07 +0200
Pankaj Chaturvedi schrieb:
[...] the problem is that <xsl:value-of> does not give the correct
output for child elements/entities ([#x002d], missing <citationref>
element etc)  of <endnote>.

Just define a template to match the first text node below <endnote>.


<xsl:transform version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:template match="endnote/text()[ 1 ]">
    <xsl:value-of select="substring-before( . , ' ')"/>
    <xsl:text>&#09;</xsl:text>
    <xsl:value-of select="substring-after( . , ' ')"/>
  </xsl:template>
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:transform>

Oddly, this doesn't work with xsltproc :-(

Michael Ludwig

Current Thread