xsl-list
[Top] [All Lists]

Re: Encoding problem or what else?

2005-12-08 07:42:23

----- Original Message ----- 
From: "George Cristian Bina" <george(_at_)oxygenxml(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Thursday, December 08, 2005 09:16
Subject: Re: [xsl] Encoding problem or what else?


Hi,

Xerces handles the UTF-8 BOM correctly since many years now. What you 
need to check is how you create the input source for the XML that you 
pass to the transformation. If you pass only the system ID then Xerces 
will escape automatically the BOM if the encoding is UTF-8. If you pass 
a Reader to the parser then it is your task to skip the UTF-8 BOM. IIRC 
there is a bug on Sun bugzilla that says that the InputStreamReader does 
not skip the UTF-8 BOM when you give it a UTF-8 byte stream.

Now the error message: "Document root element is missing." seems 
different than what Xerces gives if you enter a character before the XML 
header: "The processing instruction target matching "[xX][mM][lL]" is 
not allowed." so it is possible that you are using some other XML parser.

Hope that helps,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



Yes, as Micheal explained JDK 1.4.2 is using the "crimson" parser.
Now my problem is to understand how to replace this with xerces.

Thanks!
Bye,
Flavio

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--