Re: XML and JAVA

Bernhard Gruber <[email protected]> Fri, 19 Jul 2002 09:44:33 +0200
Newsgroups gmane.comp.windows.devel.java.general
Message-ID <[email protected]>
hi kevin

tnx for your reply, I'm afraid, I've still troubles
did you meen I should do it like that : ??

       String xml =3D "<anyTag>&#252;</anyTag>";
       javax.xml.parsers.DocumentBuilderFactory dbf =3D=20
javax.xml.parsers.DocumentBuilderFactory.newInstance();
       dbf.setExpandEntityReferences(false);
       javax.xml.parsers.DocumentBuilder db =3D dbf.newDocumentBuilder();
       Document doc =3D db.parse(new InputSource(new StringReader(xml)));

The "anyTag" Node has still the value "=FC" instead of "&#525;"

any further help available ??

thanks

bernie

At 20:12 18.07.2002 +0100, you wrote:
>If you can use JAXP, call setExpandEntityReferences(false) on the
>DocumentBuilderFactory, the default value for this is 'true'. If you're
>not/cannot using JAXP check out the features of your parser, they should
>let you disable this expansion,
>
>Kevin Jones
>Developmentor
>www.develop.com

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