Re: XML and JAVA

David Symanowicz <[email protected]> Thu, 18 Jul 2002 14:54:08 -0400
Newsgroups gmane.comp.windows.devel.java.general
Message-ID <[email protected]>
Berhard,

My experiences with XML parsers has been similar, even outside of Java (can
I say that in this discussion group??).  I believe that once the document is
loaded into a DOM, the entities are converted to their character based form,
probably so that the containing object can display it without requiring
further transformation.

In my case, the XML was coming from an application server, which
unfortunately loaded the string in to a DOM on its side causing an "ö" to be
sent rather than its entity encoded equivalent.  I ended up writing the
response to disk and re-encoding it as I did.

Don't know if that helps, but at least you're not alone...

-Dave



-----Original Message-----
From: Java Discussion [mailto:[email protected]]On Behalf Of
Bernhard Gruber
Sent: Thursday, July 18, 2002 1:36 PM
To: [email protected]
Subject: [JAVA] XML and JAVA


hallo all

I have following problem :

I convert a String into an XML Document this way


       DOMParser parser = new DOMParser();
       parser.parse(new InputSource(new StringReader(xml)));
       result = parser.getDocument();

the Problem is, that the String contains HTTPEntities like "&#252;"  (==
"ü" for example) ->
the resulting XML contains then a "ü" instead of "&#252;"

anybody an idea ??

tnx

bernie

You can read messages from the JAVA archive, unsubscribe from JAVA,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the JAVA archive, unsubscribe from JAVA,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.