cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reinhard Haller" <reinhard.hal...@interactive-net.de>
Subject serializer output encoding
Date Wed, 25 May 2005 10:37:36 GMT
Hi,

I've problems with the output encoding of the xml-serializer.

Getting an utf-8 encoded &Uuml; from the HTML-Generator
with hex-code 0xc39c I expected the corresponding iso-8859-1
character &220; in output after the serializer.

The serializer passes the utf-8 characters unchanged to output.

What's wrong?

Thanks
Reinhard Haller

Cocoon-Version: 2.1.7
-------------------------- sitemap.xmap -----------------------------
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
	<map:components>
		<map:generators default="file">
			<map:generator name="html-utf-8"
src="org.apache.cocoon.generation.HTMLGenerator">
				<jtidy-config>utf-8.properties</jtidy-config>
			</map:generator>
		</map:generators>
		<map:transformers default="xsltc">
			<map:transformer
logger="sitemap.transformer.xsltc" 
							 
name="xsltc-utf-8" pool-max="32" 
							 
src="org.apache.cocoon.transformation.TraxTransformer">
				<use-request-parameters>false</use-request-parameters>
				<use-session-parameters>false</use-session-parameters>
				<use-cookie-parameters>false</use-cookie-parameters>
				<xslt-processor-role>xsltc</xslt-processor-role>
				<check-includes>true</check-includes>
				<encoding>utf-8</encoding>
			</map:transformer>
		</map:transformers>
		<map:serializers>
			<map:serializer name="xml"         
							  
src="org.apache.cocoon.serialization.XMLSerializer"
							  
mime-type="text/xml; charset=iso-8859-1">
				<encoding>iso-8859-1</encoding>
			</map:serializer> 
			<map:serializer name="xml-utf-8"         
							  
src="org.apache.cocoon.serialization.XMLSerializer"
							  
mime-type="text/xml; charset=utf-8">
				<encoding>utf-8</encoding>
			</map:serializer> 
		</map:serializers>
	</map:components>
	<map:pipelines>
		<map:pipeline>
            <map:match pattern="cwc.xhtml">
                <map:generate type="html-utf-8"
src="http://www.computerwoche.de/index.cfm?pageid=254&amp;type=detail&amp;artid=74090&amp;linktype=rss&amp;category=318"
/>
                <map:transform name="xsltc-utf-8"
src="html2desc.xslt"/>
                <map:serialize type="xml"/>
            </map:match>
		</map:pipeline>
	</map:pipelines>
</map:sitemap>
-------------------------- html2desc.xslt
-----------------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
					 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
					 
xmlns:xh="http://www.w3.org/1999/xhtml"
					  exclude-result-prefixes="xh">

<xsl:output omit-xml-declaration="yes"
                encoding="UTF-8"
                indent="yes" />
                
<xsl:template match="/">
	<xsl:variable name="raw"
select="//xh:td[@class='DetailText']/xh:p[preceding-sibling::xh:span[@id='intelliTxt']][1]"
/>
	<xsl:element name="description" namespace="">
		<xsl:text
disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
		<xsl:copy-of select="$raw/node()" />
		<xsl:text
disable-output-escaping="yes">]]&gt;</xsl:text>
	</xsl:element>
</xsl:template>

</xsl:stylesheet>
-------------------------- utf-8.properties
-----------------------------
indent= auto
indent-spaces= 2
wrap= 72
markup= yes
output-xhtml= yes
output-xml= no
input-xml= no
show-warnings= yes
numeric-entities= yes
quote-marks= yes
quote-nbsp= yes
quote-ampersand= yes
break-before-br= no
uppercase-tags= no
uppercase-attributes= no
input-encoding= utf-8
output-encoding= utf-8
character-encoding= utf-8


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message