If your documents are encoded in ISO-8859-1 they should
indicate this property with the encoding attribute in
the xml prolog: <?xml version="1.0" encoding="ISO-8859-1"?>
Since UTF-8 is the default encoding (due to the XML specifications)
your parser is right but your documents are not correctly defined. Therefore I would suggest that you use a cotrective approach like
the script proposed by Fergus. This way you would not only
solve your problem but at the same time correct your documents.
Sincerely,
Thierry Hanser
PS: I am not perl expert but does Fregus' expression apply only
to the xml prolog (which is required) or to all processing instruction (ending by '?>') in which case you need to check that you do not have
other useful processing instructions.
-----------------------------------------------------------------------
IXELIS - Semantic Information Systems
Web: http://www.ixelis.com E-mail : [EMAIL PROTECTED]
-----------------------------------------------------------------------
Not a direct answer, but....$ find . -name "*.xml" | xargs perl -i.bak \ -p -e "s/?>/ encoding='iso-8859-1'?>/" will do the bulk change for you. On Tue, Dec 10, 2002 at 12:14:19PM +0100, [EMAIL PROTECTED] wrote:Hello,
I have a problem with lot's of XML-files I want to parse with the
SAXReader object. They all start with this heading:
<?xml version = "1.0" standalone = "no"?>
<!DOCTYPE configData SYSTEM "configFile.dtd">
Even if the attribute
'encoding="UTF-8"'
is not there in the preamble, it seems that my parser implements
this as default, since norwegian charcters are not recognized as
valid.
Is there anyway I can override this default? Guess I need to enforce the setting 'encoding="ISO-8859-1"', but it
would be reeealy neat if I could do this in the code, not having
to edit all the files manually...
Best regards,
Helge Fredriksen
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user