xsl-list
[Top] [All Lists]

Re: Retaining Comments

2005-11-22 09:57:41
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.

I don't think the xml parser has to report comments, so its worth
checking that the one you are using isn't dropping them.

Then it depends on how you are doing the copy in your XSLT, you may
just need to provide a matching template as the default one for
comments is to do nothing.

<xsl:template match="comment()">
  <xsl:copy>
    ....

cheers
andrew

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>