cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Corey Jewett>
Subject SGML comments and XSL
Date Sun, 17 Mar 2002 01:26:02 GMT
New cocoon user. Apologies if this is documented somewhere, but I can't
find it. 

I'm attempting to use XSL to translate XML documents, basically I'm
'skinning' the XML content with a variety of layout templates (XSL). The
current output format is HTML/XHTML.

I did a simple test and it worked great. However I ran into a kink when
I upgraded the template to a full blown layout. I'm using CSS and
JavaScript, which customarily are escaped using the standard SGML
comments <!-- -->. Since XML is SGML they're also obviously XML
comments, and as such are being (properly) stripped out of the template
and hence out of my output.

I tried embedding the comments in CDATA sections, but then they were
translated to character escapes. I then tried embedding escaped
characters &lt; and &gt; as in '&lt;!-- --&gt;'. Also to no avail.

I did some searching through the list archives and found ways to embed
comments in XSP, but not XSL. Is there a simple solution, other than
switching to XSP?

Thanks much for any help and pointers.


Pipeline Snippet:
            <map:match pattern="**/*.jcp" type="wildcard">
                <map:generate type="file" src="{1}/{2}.jcp"/>
                <map:transform type="xslt" src="{1}/template.jtp"/>

Document Snippet:
    <title>Page Title</title>
        <P>Stuff and whatnot.</P>

XSL snippets: (cropped for clarity)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<xsl:stylesheet xmlns:xsl=""
  <xsl:template match="document">
<html xmlns="">
    <title><xsl:value-of select="title"/></title>
    <meta http-equiv="Content-Type" content="text/html;
    <style type='text/css'><!-- 
      body {
        background: #FFFFFF url(../images/header/bg.gif)


      <script language = "javascript"><!--
        var path = '../';
        var section = 'programs';

  <body bgcolor="#ffffff" background="../images/header/ns3_bg.gif"
marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"

<xsl:value-of select="content"/>


Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message