You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Suresh Babu Koya <sk...@quark.co.in> on 2003/03/05 12:30:25 UTC

Characters in XML file

Hello group,
    
     I am having one XML file with the header 

     1) <?xml version="1.0" encoding="UTF-8"?>

	and another XML with the header 

     2) <?xml version="1.0" encoding="UTF-8"?>  
     
     The first one is throwing errors with some old version of XML parser
and is working fine with a newer version of Xerces parser. 
     The second XML file header is generated with the Serializer API of
Xerces and is parsed properly with both the old and newer version of
parsers. 

     May I know which of the two headers is correct as per 1.0 spec and in
which case the parser behaviour is correct.

/Suresh 

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Characters in XML file

Posted by "Jesus M. Salvo Jr." <je...@migasia.com>.
That leading character must be a Byte-Order-Marking ( BOM ).
For example, windows' notepad puts a BOM on front of a file if you tell 
it to save as UTF-8 or UTF-16.

XML parsers _should_ not treat that as an error .... but I remember 
encountering the same problems you had with Xerces 1.4.4.
I have not tried though with Xerces 2.x.



Suresh Babu Koya wrote:

>Hello group,
>    
>     I am having one XML file with the header 
>
>     1) <?xml version="1.0" encoding="UTF-8"?>
>
>	and another XML with the header 
>
>     2) <?xml version="1.0" encoding="UTF-8"?>  
>     
>     The first one is throwing errors with some old version of XML parser
>and is working fine with a newer version of Xerces parser. 
>     The second XML file header is generated with the Serializer API of
>Xerces and is parsed properly with both the old and newer version of
>parsers. 
>
>     May I know which of the two headers is correct as per 1.0 spec and in
>which case the parser behaviour is correct.
>
>/Suresh 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
>  
>


-- 
Jesus M. Salvo Jr.
Mobile Internet Group Pty Ltd
(formerly Softgame International Pty Ltd)
M: +61 409 126699
T: +61 2 94604777
F: +61 2 94603677

PGP Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC0BA5348



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org