cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject Re: Problems removing meta tag from the html output in Cocoon
Date Wed, 01 Jan 2003 15:28:52 GMT
Hello Anna,

Anna Afonchenko wrote:
> Hi all.
> Happy New 2003 Year to everyone!

the same for you and all the others on the list.

> Here is my first question this year :-)

And my first answer.

> I have a small xsl stylesheet that takes in xml and outputs html.
> Since the output method is html, xsl puts in the output the following 
> meta tag:
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> thus making the whole output file invalid xml!

Hmm, why invalid XML? You want HTML as output and the *serializer* adds 
the meta info about the encoding of the file. The meta tag is one 
possibility to tell the browser the encoding. The other one is the 
response header. But why should the meta tag contain wrong information? 
UTF-8 is the default output encoding and so the output is serialized and 
it gets the correct encoding information.

> I want to remove this line from the output.
> I found a saxon extension thing that does it, if put into the xsl:output 
> element:
> <xsl:output method="html" indent="yes" saxon:omit-meta-tag="yes" />

<xsl:output/> is completely ignored in Cocoon.

> Now here is my problem:
> If I execute this xsl through the batch file using saxon, everything is 
> fine, the meta tag is absent.
> But when I try to use it through Cocoon, the meta tag is still there.
> I thought that maybe Cocoon couldn't recognise the saxon extension, but 
> when I added inside
> my template call to saxon:path() extension, Cocoon executed it as it should.
> Here is my pipeline:
> <map:match pattern="testURL">
>     <map:generate src="test.html" type="html"/>
>     <map:transform type="xslt-saxon" src="test.xsl"/>
>     <map:serialize type="html"/>
> </map:match>
> Here is saxon xslt transformer:
> <map:transformer name="xslt-saxon" pool-grow="2" pool-max="32" 
> pool-min="8" src="org.apache.cocoon.transformation.TraxTransformer">
> <use-request-parameters>false</use-request-parameters>
> <use-browser-capabilities-db>false</use-browser-capabilities-db>
> <xslt-processor-role>org.apache.cocoon.components.xslt.XSLTProcessor/Saxon</xslt-processor-role>

If you want another encoding add it here like every other 

   and so on.

But I don't know if extension parameters like saxon:omit-meta-tag do 
work here. But I can't still see why it should be omitted.

> </map:transformer>
> So I don't understand why Cocoon does not recognise the 
> saxon:omit-meta-tag extension.
> I am getting invalid XML because of this and it really bothers me.


> Somebody encountered such a problem with Cocoon?

Not a problem, but normal behaviour ;-)

> Thank you very much for help.
> Anna

Hope I could help you in the new year too.



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