You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sharat Koya <sx...@Cs.Nott.AC.UK> on 2001/11/07 10:21:09 UTC

output to XHTML

Hi, I'm a bit of a beginner at cocoon and have been playing about with the
XML - XSL - HTML setup on cocoon. I have ran into a problem though. I would
like to output to XHTML. I relaise xsl:output doesn't work in cocoon but I'm
having the problem that <?cocoon-format type="text/xhtml"?> doesnt seem to
want to work in the style sheet to give me a XHTML doctype. Instead it gives
me a HTML one. Anyone any ideas?

Bobby Koya

test.xhtml.xsl
<?xml version="1.0"?>
<?cocoon-format type="text/xhtml"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/TR/xhtml1/strict">

<xsl:strip-space elements="doc chapter section"/>
<xsl:output
   method="xml"
   indent="yes"
   encoding="iso-8859-1"
/>

<xsl:template match="doc">
 <html>
   <head>
     <title>
       <xsl:value-of select="title"/>
     </title>
   </head>
   <body>
     <xsl:apply-templates/>
   </body>
 </html>
</xsl:template>

</xsl:stylesheet>


test.xml

<?xml version="1.0"?>
<?xml-stylesheet href="test.xhtml.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<doc>
<title>Document Title</title>
<chapter>
<title>Chapter Title</title>
<section>
<title>Section Title</title>
<para>This is a test.</para>
<note>This is a note.</note>
</section>
<section>
<title>Another Section Title</title>
<para>This is <emph>another</emph> test.</para>
<note>This is another note.</note>
</section>
</chapter>
</doc>









---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>