You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Al...@SoftHome.Net on 2002/05/30 08:35:54 UTC

UniCode - ?

Hi All,

I want to use Thai character in my XML, what should i add into my xsl or my
xml to support that Thai character. I think i have to put some line code
about Unicode.

Terima kasih,

Ali

Here is my error compile code when i tried to generate pdf using FOP.
any advise to solve this problem...?


============================================================================
============================
[INFO]: FOP 0.20.3
[DEBUG]: using SAX parser org.apache.xerces.parsers.SAXParser
[INFO]: building formatting object tree
[DEBUG]: setting up fonts
file:/c:/ali/sonnet/xmlsonnet.xml; Line 13; Column 12; [ERROR]: An invalid
XML character (Unicode: 0
org.apache.fop.apps.FOPException: An invalid XML character (Unicode: 0xb7)
was found in the element
        at org.apache.fop.apps.Driver.render(Driver.java:486)
        at
org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:72)
        at org.apache.fop.apps.Fop.main(Fop.java:19)

---------

org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0xb7) was
found in the element con
        at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1056)
        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
LDocumentScan
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java, Compile
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948)
        at
org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:130)
        at org.apache.fop.apps.Driver.render(Driver.java:481)
        at
org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:72)
        at org.apache.fop.apps.Fop.main(Fop.java:19)





Re: UniCode - ? - CLOSED

Posted by Al...@SoftHome.Net.
Thanks J,

it's work and i want to share about encoding hope it help for others.

try this free site :
http://www.w3schools.com/xml/xml_encoding.asp


Terima kasih,

Ali

----- Original Message -----
From: J.Pietschmann <j3...@yahoo.de>
To: <fo...@xml.apache.org>
Sent: Sunday, June 02, 2002 3:00 PM
Subject: Re: UniCode - ?


ali_binus@softhome.net wrote:
> yeah that is what i mean. Where and how i put the encoding? (the
declaration
> or what ever in my line code..)

The first line of an XML file is the XML declaration.
   <?xml version="1.0"?>
You can declare an encoding there:
   <?xml version="1.0" encoding="UTF-8"?>
UTF-8 ist the default encoding, so the two declarations are
equivalent.
Every XML parser has to understand UTF-8 and UTF-16, most
understand other encodings, like ISO-8859-1 (Latin-1).

> and how i know the type of encoding that i use?

There is no way to diagnose this remotely, you have to
know this by yourself. Most editors only know "native
encoding", some of the more recent provide for choosing
an encoding while saving.

> actually i want to use Thai
> encoding, but i don't know from where i get the encoding type for the
Thai.

In general, you don't have to. If you have an editor which
natively supports entering Thai characters, check the
documentation or whatever configuration settings the editor
has for the encoding used. Set the encoding name in the
XML declaration and hope the XML parser understands it (if
not, you'll get an error). If you can choose the encoding,
prefer UTF-8 or UTF-16.
If you have an ASCII editor, you can use XML character references
for entering Thai characters. You just wont see Thai glyphs on
the screen. The Thai characters start at Unicode code point
U+0E00, you can use &0x0E01; etc.


J.Pietschmann




Re: UniCode - ?

Posted by roni nemerovsky - hotmail <ro...@hotmail.com>.
Did you mean to send this response to me !? 
Is this response the reply to my problem !?
Roni N.


----- Original Message ----- 
From: "J.Pietschmann" <j3...@yahoo.de>
To: <fo...@xml.apache.org>
Sent: Sunday, June 02, 2002 11:00 AM
Subject: Re: UniCode - ?


ali_binus@softhome.net wrote:
> yeah that is what i mean. Where and how i put the encoding? (the declaration
> or what ever in my line code..)

The first line of an XML file is the XML declaration.
   <?xml version="1.0"?>
You can declare an encoding there:
   <?xml version="1.0" encoding="UTF-8"?>
UTF-8 ist the default encoding, so the two declarations are
equivalent.
Every XML parser has to understand UTF-8 and UTF-16, most
understand other encodings, like ISO-8859-1 (Latin-1).

> and how i know the type of encoding that i use?

There is no way to diagnose this remotely, you have to
know this by yourself. Most editors only know "native
encoding", some of the more recent provide for choosing
an encoding while saving.

> actually i want to use Thai
> encoding, but i don't know from where i get the encoding type for the Thai.

In general, you don't have to. If you have an editor which
natively supports entering Thai characters, check the
documentation or whatever configuration settings the editor
has for the encoding used. Set the encoding name in the
XML declaration and hope the XML parser understands it (if
not, you'll get an error). If you can choose the encoding,
prefer UTF-8 or UTF-16.
If you have an ASCII editor, you can use XML character references
for entering Thai characters. You just wont see Thai glyphs on
the screen. The Thai characters start at Unicode code point
U+0E00, you can use &0x0E01; etc.


J.Pietschmann



Re: UniCode - ?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
ali_binus@softhome.net wrote:
> yeah that is what i mean. Where and how i put the encoding? (the declaration
> or what ever in my line code..)

The first line of an XML file is the XML declaration.
   <?xml version="1.0"?>
You can declare an encoding there:
   <?xml version="1.0" encoding="UTF-8"?>
UTF-8 ist the default encoding, so the two declarations are
equivalent.
Every XML parser has to understand UTF-8 and UTF-16, most
understand other encodings, like ISO-8859-1 (Latin-1).

> and how i know the type of encoding that i use?

There is no way to diagnose this remotely, you have to
know this by yourself. Most editors only know "native
encoding", some of the more recent provide for choosing
an encoding while saving.

> actually i want to use Thai
> encoding, but i don't know from where i get the encoding type for the Thai.

In general, you don't have to. If you have an editor which
natively supports entering Thai characters, check the
documentation or whatever configuration settings the editor
has for the encoding used. Set the encoding name in the
XML declaration and hope the XML parser understands it (if
not, you'll get an error). If you can choose the encoding,
prefer UTF-8 or UTF-16.
If you have an ASCII editor, you can use XML character references
for entering Thai characters. You just wont see Thai glyphs on
the screen. The Thai characters start at Unicode code point
U+0E00, you can use &0x0E01; etc.


J.Pietschmann


Re: UniCode - ?

Posted by "ali_binus@softhome.net" <Al...@SoftHome.net>.
J.Pietschmann,

yeah that is what i mean. Where and how i put the encoding? (the declaration
or what ever in my line code..)
and how i know the type of encoding that i use? actually i want to use Thai
encoding, but i don't know from where i get the encoding type for the Thai.

could you please to teach me about it?

Terima kasih,

Ali




----- Original Message -----
From: "J.Pietschmann" <j3...@yahoo.de>
To: <fo...@xml.apache.org>
Sent: Friday, May 31, 2002 4:15 AM
Subject: Re: UniCode - ?


> Ali_Binus@SoftHome.Net wrote:
> > I want to use Thai character in my XML, what should i add into my xsl or
my
> > xml to support that Thai character. I think i have to put some line code
> > about Unicode.
> ...
> > Here is my error compile code when i tried to generate pdf using FOP.
> > any advise to solve this problem...?
> > file:/c:/ali/sonnet/xmlsonnet.xml; Line 13; Column 12; [ERROR]: An
invalid
> > XML character (Unicode: 0
> > org.apache.fop.apps.FOPException: An invalid XML character (Unicode:
0xb7)
> > was found in the element
> >         at org.apache.fop.apps.Driver.render(Driver.java:486)
>
> Odd, 0xb7 is not an illegal XML character by itself.
> Check whether the encoding declaration at the beginning of the
> XML source file matches the actual encoding. It might have been
> corrupted by transport (download). Most likely, the encoding or
> even the whole XML declaration got lost, which means the parser
> assumes UTF-8 encoding, while the actual encoding is something
> else.
>
> J.Pietschmann
>


Re: UniCode - ?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Ali_Binus@SoftHome.Net wrote:
> I want to use Thai character in my XML, what should i add into my xsl or my
> xml to support that Thai character. I think i have to put some line code
> about Unicode.
...
> Here is my error compile code when i tried to generate pdf using FOP.
> any advise to solve this problem...?
> file:/c:/ali/sonnet/xmlsonnet.xml; Line 13; Column 12; [ERROR]: An invalid
> XML character (Unicode: 0
> org.apache.fop.apps.FOPException: An invalid XML character (Unicode: 0xb7)
> was found in the element
>         at org.apache.fop.apps.Driver.render(Driver.java:486)

Odd, 0xb7 is not an illegal XML character by itself.
Check whether the encoding declaration at the beginning of the
XML source file matches the actual encoding. It might have been
corrupted by transport (download). Most likely, the encoding or
even the whole XML declaration got lost, which means the parser
assumes UTF-8 encoding, while the actual encoding is something
else.

J.Pietschmann


image problem

Posted by zahid <za...@hotmail.com>.
i have problem with this code when i put image here as given below it works
properly when i remove the image the pdf cannot be generated
i am using turbine frame work and set the mime type "application/pdf" and
put in the output stream of response to directly display on the screen
if any one know the reason
plz tell me

            <fo:page-sequence master-name="psmA">
                <!-- header -->
                <fo:static-content flow-name="xsl-region-before">
                    <fo:block>
                        <fo:external-graphic width="1in"
src="file:/D:\\Java\\tools\\tdk2.1\\webapps\\pso\\images\\logo.jpg"/>
                    </fo:block>
                </fo:static-content> ................................