Strip comments from XML documents

C

CI

I have to create a new XML document from the exising one, by adding
some additional tags, etc..

My question is as follows: how to strip XML comments from the existing
document?

The identity tranform below copies all the nodes, including comment
nodes.


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:eek:utput method="xml" indent="yes"/>

<xsl:template match="node( ) | @*">
<xsl:copy>
<xsl:apply-templates select="@* | node( )" />
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Thanks in Advance

Michael
 
S

Soren Kuula

CI said:
I have to create a new XML document from the exising one, by adding
some additional tags, etc..

My question is as follows: how to strip XML comments from the existing
document?

The identity tranform below copies all the nodes, including comment
nodes.


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:eek:utput method="xml" indent="yes"/>

<xsl:template match="node( ) | @*">
<xsl:copy>
<xsl:apply-templates select="@* | node( )" />
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Thanks in Advance

Michael
Soren
 

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,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top