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

Re: [xsl] Using copy to change a node, whilst retaining the attributes


Subject: Re: [xsl] Using copy to change a node, whilst retaining the attributes
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Mon, 04 Aug 2003 20:42:35 +0200

John Reid wrote:
I would like to go from A to B, preferably
with code that copys across all attributes and does not copy across the
text node for <yes> but creates a new text node for <yes>
...
    <yes ID="20030722" WE="Tu">A</yes>
    <yes ID="20030729" WE="Tu">A</yes>
    <yes ID="20030805" WE="Tu">A</yes>
    <yes ID="20030809" WE="Sa">D</yes>
...
  <dates>
    <yes ID="20030722" WE="Tu">A</yes>
    <yes ID="20030729" WE="Tu">A</yes>
    <yes ID="20030805" WE="Tu">A</yes>
    <yes ID="20030809" WE="Sa">C</yes>

Try <xsl:template match="yes"> <xsl:copy> <xsl:copy-of select="@*"/> <!-- your logic for the text here --> </xsl:copy> </xsl:template>

Did you look into the FAQ?

J.Pietschmann


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread