XSL & XML comments?

Chris (16)

Usenet Archive
Joined
Jul 28, 2003
Messages
20
Reaction score
0
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
 

Chris (16)

Usenet Archive
Joined
Jul 28, 2003
Messages
20
Reaction score
0
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>
 

Dean Tiegs

Usenet Archive
Joined
Oct 6, 2002
Messages
29
Reaction score
0
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

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,798
Members
249,594
Latest member
henrywalsh

Latest Threads

Top