cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: including html piece
Date Fri, 04 Aug 2000 00:50:01 GMT
On Fri, 4 Aug 2000, Mariusz Nowostawski wrote:

> Sorry, I should have done it before I have originally posted the question 
> - After updating to Cocoon-1.8-dev from CVS the exception which I was
> quoting for Cocoon-1.7.4 is not any more the case, which is good. 
> However, now I think I have exactly the same situation as Ulrich (if I
> recall correctly):
> 
> I have simple XML source which is processed by XSLT and produces HTML
> page.
> 
> the XSL looks like:
> 
> <?xml version="1.0"?>
> <?cocoon-process type="xinclude"?>

cocoon PIs don't belong in stylesheets. you're doing the right thing below
by creating the PI using xsl:processing-instruction - if i understand your
intent anyway.

> <xsl:stylesheet 
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
>     xmlns:xinclude="http://www.w3.org/1999/XML/xinclude" >
> 
> <xsl:template match="modules">
> <xsl:processing-instruction name="cocoon-process">type="xinclude"</xsl:processing-instruction>
> <xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
> <html>
>  <head>
>    <LINK href="/stylesheets/secmlA.css" rel="stylesheet" type="text/css"/>
>    <title><xsl:text>Resources</xsl:text></title>
>  </head>
>  <body>
>    <xinclude:include parse="xml" href="menu.htmlf" />

this is no longer valid - see the latest version of the xinclude working
draft.

> [...]
> 
>  </body>
> </html></xsl:stylesheet>
> 
> and it produces HTML with:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
> <html xmlns:xinclude="http://www.w3.org/1999/XML/xinclude">
> <head><LINK href="/stylesheets/secmlA.css" rel="stylesheet" type="text/css">
> <title>Resources</title>
> <body>
>  <xinclude:include href="menu.htmlf" parse="xml"></xinclude:include>
> 
> [...]
> 
> btw, this menu.htmlf is a fragment of proper XHTML, i.e. a single table.
> Why this xinclude instruction is not beeing processed? Am I doing
> something wrong way? Swapping the order of PIs does not help.

i think if you fix your syntax it should work. check out the latest cvs
version and send me the output if my suggestion does _not_ work.

- donald


Mime
View raw message