XSL & XML comments?

C

chris

Hi,

Is it possible to preserve comments in XSL? I would like to take a XML
document and merge it with another, but comments and text are not
copied, only elements and their values.

Any ideas?


Cheers,
Chris
 
C

chris

chris said:
Any ideas?

Found this snippet on the web eventually!

<!-- pass unrecognized nodes along unchanged -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
 
D

Dean Tiegs

chris said:
Is it possible to preserve comments in XSL? I would like to take a
XML document and merge it with another, but comments and text are
not copied, only elements and their values.

<xsl:template select="comment()">
<xsl:copy/>
</xsl:template>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top