You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Grant Robinson <sa...@kermit.mr-r.net> on 2000/06/16 21:44:47 UTC

Setting XML info for the parser.

I am currently putting the following tag at the beginning of a number of XML
files that are being populated by info from a database.
    <?xml version="1.0" encoding="ISO-8859-1"?>
The problem is that it is causing problems with another program that uses
these files.  I only need it in the XML file while it is being parsed.  Is
there are way to set the Parser to parse all documents as though they were
XML version 1.o with an encoding of ISO-8559-1?  I looked through the API
docs and examples, but I couldn't find anything that looked like what I was
looking for.  Any help would be appreciated.


Thanks in advance,

--
Grant Robinson
Solutions Engineer
Nextpage L.C.


Re: Setting XML info for the parser.

Posted by Mike Pogue <mp...@apache.org>.
The XML rules state that if the encoding clause isn't there,
the parser should assume a UTF-8 encoding.

However, remember that the lower 7 bits of UTF-8 are essentially
iso-8859-1, so you can leave off the encoding clause, if your 
iso-8859-1 data stays within the lower 7 bits of the encoding
(where iso-8859-1 and UTF-8 are identical).

Mike

Grant Robinson wrote:
> 
> I am currently putting the following tag at the beginning of a number of XML
> files that are being populated by info from a database.
>     <?xml version="1.0" encoding="ISO-8859-1"?>
> The problem is that it is causing problems with another program that uses
> these files.  I only need it in the XML file while it is being parsed.  Is
> there are way to set the Parser to parse all documents as though they were
> XML version 1.o with an encoding of ISO-8559-1?  I looked through the API
> docs and examples, but I couldn't find anything that looked like what I was
> looking for.  Any help would be appreciated.
> 
> Thanks in advance,
> 
> --
> Grant Robinson
> Solutions Engineer
> Nextpage L.C.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org