You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mariusz Nowostawski <ma...@marni.otago.ac.nz> on 2000/10/30 01:58:42 UTC
xinclude in stylesheet again
Hi,
I have been trying it before, but I have failed. I decided now that I need
to have a closure on this, once and for ever ;o)
I have xml file with data, html file (html fragment) with a side-menu, and
one xsl stylesheet which formats data, adds a side menu, and shows it in a
browser as HTML page, and second xsl stylesheet which formats data as
PDF. All is fine, but I have more than one xml data file, and all use the
same side-menu, so why not to use xinclude. In my stylesheet I do then:
<xsl:template match="whatever">
<xsl:processing-instruction name="cocoon-process">type="xinclude"</xsl:processing-instruction>
<xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
<html>
[...] usual html stuff
<body>
<x xmlns:xinclude="http://www.w3.org/1999/XML/xinclude">
<include xinclude:parse="html" xinclude:href="menu.html"/>
</x>
[...] my data table
</body>
</html>
</xsl:template>
[...] other templates
</xsl:stylesheet>
As a result I am getting HTML page, with:
[...]
<body>
<x xmlns:xinclude="http://www.w3.org/1999/XML/xinclude"><include xinclude:href="menu.htmlf" xinclude:parse="html"></include></x>
</body><!--Processed by XInclude--></html>
[...]
The tag <x> is not processed, but the page itself was processed by
XInclude processor, because there is a comment suggesting it. What I am
doing wrong? If somebody used xinclude in a stylesheet, could she/he
explain how it was achieved?
regards
mariusz