You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by makoto hirayama <hi...@mac.com> on 2005/04/24 17:56:01 UTC
How to stop using numeric entities?
Hi,
I publish japanese page with Cocoon 2.1.6.
It works correctly but all japanese characters changed to numeric entities.
ex.)
こんにちは ('ko-n-ni-chi-wa', it's Japanese 'Hello')
->
こんにちは
How to stop using numeric entities?
Sorry my poor english.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How to stop using numeric entities?
Posted by Ben Pope <be...@gmail.com>.
makoto hirayama wrote:
> Thanks, Ben.
>
>
>>hello.xml:
>><?xml version="1.0" encoding="Windows-31J"?>
>><page xml:lang="ja">...
>>
>>hello.xsl:
>><?xml version="1.0" encoding="Windows-31J"?>
>><xsl:stylesheet version="1.0"
>>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>><xsl:output encoding="Windows-31J"?>
>><xsl:template xml:lang="ja">...
>
>
> This solution did not effect, but
>
>
>> <xsl:attribute name="disable-output-escaping">true</xsl:attribute>
>
>
> I solved my problem by the grace of your idea.
>
> like this,
>
> <xsl:template match="page">
> <html><head><title>
> <xsl:value-of select="title" disable-output-escaping="yes"/>
> </title></head><body>
> <xsl:apply-templates/>
> </body></html>
> </xsl:template>
>
> <xsl:template match="para">
> <p><xsl:apply-templates /></p>
> </xsl:template>
>
> <xsl:template match="text()">
> <xsl:value-of select="." disable-output-escaping="yes"/>
> </xsl:template>
Glad we got there in the end!
Ben
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How to stop using numeric entities?
Posted by makoto hirayama <hi...@mac.com>.
Thanks, Ben.
> hello.xml:
> <?xml version="1.0" encoding="Windows-31J"?>
> <page xml:lang="ja">...
>
> hello.xsl:
> <?xml version="1.0" encoding="Windows-31J"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output encoding="Windows-31J"?>
> <xsl:template xml:lang="ja">...
This solution did not effect, but
> <xsl:attribute name="disable-output-escaping">true</xsl:attribute>
I solved my problem by the grace of your idea.
like this,
<xsl:template match="page">
<html><head><title>
<xsl:value-of select="title" disable-output-escaping="yes"/>
</title></head><body>
<xsl:apply-templates/>
</body></html>
</xsl:template>
<xsl:template match="para">
<p><xsl:apply-templates /></p>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:template>
makoto
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How to stop using numeric entities?
Posted by Ben Pope <be...@gmail.com>.
makoto hirayama wrote:
> On 2005.04.25, at 10:04, Ben Pope <be...@gmail.com> wrote:
>
>
>>What about the encoding of your original files?
>>
>>hello.xml:
>><?xml encoding="Shift-JIS"?>
>><yada yada>
>>
>>hello.xsl:
>><?xml encoding="Shift-JIS"?>
>><xsl:output encoding="Shift-JIS">
>><yada yada>
>
>
> My files are
>
> hello.xml:
> <?xml version="1.0" encoding="Windows-31J"?>
> <page>...
>
> hello.xsl:
> <?xml version="1.0" encoding="Windows-31J"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output encoding="Windows-31J"?>
> <xsl:template...>
What about:
hello.xml:
<?xml version="1.0" encoding="Windows-31J"?>
<page xml:lang="ja">...
hello.xsl:
<?xml version="1.0" encoding="Windows-31J"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="Windows-31J"?>
<xsl:template xml:lang="ja">...
And if that doesn't work, what about the identity transform with
disable-output-escaping?
I don't know how to make that work, but for an individual node (called
"item") it might look something like:
<?xml version="1.0"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="item">
<xsl:copy>
<xsl:attribute name="disable-output-escaping">true</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:transform>
Ben
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How to stop using numeric entities?
Posted by makoto hirayama <hi...@mac.com>.
On 2005.04.25, at 10:04, Ben Pope <be...@gmail.com> wrote:
>What about the encoding of your original files?
>
>hello.xml:
><?xml encoding="Shift-JIS"?>
><yada yada>
>
>hello.xsl:
><?xml encoding="Shift-JIS"?>
><xsl:output encoding="Shift-JIS">
><yada yada>
My files are
hello.xml:
<?xml version="1.0" encoding="Windows-31J"?>
<page>...
hello.xsl:
<?xml version="1.0" encoding="Windows-31J"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="Windows-31J"?>
<xsl:template...>
makoto
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How to stop using numeric entities?
Posted by Ben Pope <be...@gmail.com>.
makoto hirayama wrote:
> Hi, Ben.
>
> I try serialising as Windows-31J (Shift_JIS).
>
> My pipeline and component configurations are very simple.
>
> -generator -> FileGenerator
> -transformer -> TraxTransformer
> -serializer -> HTMLSerializer -> <encoding>Windows-31J</encoding>
> I use standard Cocoon components.
>
> And pipeline,
>
> <map:pipleline>
> <map:match pattern="hello.html">
> <map:generate src="hello.xml">
> <map:transform src="hello.xsl">
> <map:serialize />
> </map:pipleline>
>
> 'hello.xml' contains 'ko-n-ni-chi-wa'.
>
> I want to publish 'ko-n-ni-chi-wa' as is in hello.html,
> but its wards are changed to 'こんにちは'.
>
> thanks.
What about the encoding of your original files?
hello.xml:
<?xml encoding="Shift-JIS"?>
<yada yada>
hello.xsl:
<?xml encoding="Shift-JIS"?>
<xsl:output encoding="Shift-JIS">
<yada yada>
Ben
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How to stop using numeric entities?
Posted by makoto hirayama <hi...@mac.com>.
Hi, Ben.
I try serialising as Windows-31J (Shift_JIS).
My pipeline and component configurations are very simple.
-generator -> FileGenerator
-transformer -> TraxTransformer
-serializer -> HTMLSerializer -> <encoding>Windows-31J</encoding>
I use standard Cocoon components.
And pipeline,
<map:pipleline>
<map:match pattern="hello.html">
<map:generate src="hello.xml">
<map:transform src="hello.xsl">
<map:serialize />
</map:pipleline>
'hello.xml' contains 'ko-n-ni-chi-wa'.
I want to publish 'ko-n-ni-chi-wa' as is in hello.html,
but its wards are changed to 'こんにちは'.
thanks.
On 2005.04.25, at 02:01, Ben Pope <be...@gmail.com> wrote:
>makoto hirayama wrote:
>> Hi,
>>
>> I publish japanese page with Cocoon 2.1.6.
>> It works correctly but all japanese characters changed to numeric entities.
>>
>> ex.)
>> こんにちは ('ko-n-ni-chi-wa', it's Japanese 'Hello')
>> ->
>> こんにちは
>>
>> How to stop using numeric entities?
>>
>> Sorry my poor english.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>
>Perhaps you could try serialising as UTF-16?
>
>What is your pipeline and component configurations?
>
>Ben Pope.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How to stop using numeric entities?
Posted by Ben Pope <be...@gmail.com>.
makoto hirayama wrote:
> Hi,
>
> I publish japanese page with Cocoon 2.1.6.
> It works correctly but all japanese characters changed to numeric entities.
>
> ex.)
> こんにちは ('ko-n-ni-chi-wa', it's Japanese 'Hello')
> ->
> こんにちは
>
> How to stop using numeric entities?
>
> Sorry my poor english.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
Perhaps you could try serialising as UTF-16?
What is your pipeline and component configurations?
Ben Pope.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org