cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sharat Koya <sxk...@Cs.Nott.AC.UK>
Subject output to XHTML
Date Wed, 07 Nov 2001 09:21:09 GMT
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message