xsl-list
[Top] [All Lists]

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

2008-05-06 01:04:36
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--