[xsl] Xalan and copying comments

Subject: [xsl] Xalan and copying comments
From: MrDemeanour <mrdemeanour@xxxxxxxxxxxxxx>
Date: Fri, 07 Apr 2006 18:26:00 +0100
Hi,

I'm trying to copy a HTML fragment that contains a comment, preserving
the comment. As far as I can see, the XSLT processor relies on a DOM
that doesn't preserve comments. As I understand it, this is legal
(although it seems completely nutty to me).

As a consequence, it seems that putting this construct into a template
produces no output when using Xalan:
<xsl:comment>This is where the comment would appear</xsl:comment>

Is that correct? Could it be that I've missed something obvious? The
same construct presents no problems to Saxon.

If so, how is one supposed to preserve a comment across a transformation?

<script type="text/javascript">
<!--
[horrible but necessary javascript goes here]
-->
</script>

Regards,
Jack.

Current Thread