NewBie: How do I prevent &null; substitution

B

Brad Foster

How do I prevent apache xerces parser from substituting a &null; with a "".

This is what I am doing currently....

DOMParser myparser = new DOMParser();

myparser
..setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes",
false);

myparser
..setFeature("http://apache.org/xml/features/dom/include-ignorable-whitespace
", false);

myparser .setFeature ("http://xml.org/sax/features/namespaces", false);

myparser .setFeature ("http://xml.org/sax/features/validation", false);

myparser .parse (new InputSource(new FileInputStream(fileName)));

document = myparser .getDocument ();



When I try to get a value of an attribute which has &null; it seems to be
substituting it with a ""
 
R

Richard Tobin

Brad Foster said:
How do I prevent apache xerces parser from substituting a &null; with a "".

If &null; is a reference to an internal entity there may well be no
way to do it, since the XML spec requires internal entity references
to be replaced. You should not expect to be able to distinguish
an entity reference from the same text without an entity reference.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top