Re: [xsl] Retaining Comments

Subject: Re: [xsl] Retaining Comments
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Tue, 22 Nov 2005 17:54:41 +0100
Try this:

  <xsl:template match="comment()">
    <xsl:copy-of select="." />
  </xsl:template>

And replace comment() by processing-instruction() if you want to retain processing instructions..

Regards,
Geert

Fraser Goffin wrote:

I note that when I create (copy) an XSLT from another XSLT and the source contains comments, these are not copied across. I undestand that comments may not be significant to an XSLT processor but does anyone know whether it is in fact possible to copy them to the output.

The situation I have is a base XSLT which is then transformed into a new XSLT with some small amendments, but I wnat to keep all of the useful comments that were in the original.

Thanks

Fraser.



-- Drs. G.P.H. Josten Consultant



Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.


Current Thread