Insert comment into HTML output

Discussion in 'XML' started by RSG, Nov 9, 2004.

  1. RSG

    RSG Guest

    Hi,

    Stupid question: how do I get an XSLT stylesheet to emit a comment
    into the HTML output file?

    Obviously this won't work; it's interpreted as a comment in the
    stylesheet:

    <template ...>
    ...
    <!-- My Comment -->
    ...
    </template>

    This doesn't either; it ends up displaying the comment when the HTML
    file is viewed in a browser:

    <template ...>
    ...
    &lt!-- My Comment --&gt
    ...
    </template>

    Closer, though, in that it ends up in the HTML file, but verbatim, not
    as an actual comment.

    I've also tried CDATA, but that doesn't work either. This must be
    possible, right? Any ideas?

    Thanks!
    RSG, Nov 9, 2004
    #1
    1. Advertising

  2. RSG

    Joris Gillis Guest

    Hi,

    > Stupid question: how do I get an XSLT stylesheet to emit a comment
    > into the HTML output file?
    > This must be possible, right?


    Off course it is :)

    use:
    <xsl:comment>My Comment</xsl:comment>


    regards,

    --
    Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
    Ceterum censeo XML omnibus esse utendum
    Joris Gillis, Nov 9, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alec S.
    Replies:
    10
    Views:
    10,147
    Alec S.
    Apr 16, 2005
  2. Replies:
    3
    Views:
    12,164
    Beauregard T. Shagnasty
    Jan 10, 2006
  3. mcnewsxp

    insert html into html

    mcnewsxp, Mar 30, 2010, in forum: HTML
    Replies:
    24
    Views:
    4,415
    cipherd
    Jan 7, 2012
  4. Amit
    Replies:
    1
    Views:
    140
    Lasse Reichstein Nielsen
    Dec 11, 2003
  5. ste-m
    Replies:
    1
    Views:
    315
Loading...

Share This Page