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 ya...@bnpparibas.com on 2002/06/13 16:52:47 UTC

xml parsing

Hi

I have a problem with the parsing of a xml file/stream in java. I have some
xml files. With some of them I have no problem of parsing.
But with other files I have no results. These other files contain special
caracters like(from a pdf file):
"ÐÏࡱá>þÿ     ¢¤þÿÿÿ¨©ª«¬­®¯°±²³´µ¶£ÿÿÿÿÿÿÿÿÿÿÿÿÿ"

The encoding of my XML file is: encoding="iso-8859-1".

I would like to parse these files with my parser(DOM). I think I must
change the encoding of my parser(to have UTF-16   (coded on 2 bytes) ), but
I don't know how...


DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder dob = dbf.newDocumentBuilder();
.....
File filexml= new File(strxml);
Document doc = dob.parse(strxml);

Thank you in advance,
Best wishes




This message and any attachments (the "message") is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

                ---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le 
"message") sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.


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