Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Ignoring whitespaces without DTD validation

843834Mar 29 2005 — edited Mar 29 2005
Hi!
I've been having some problems parsing an XML file with DOM, because I get text Nodes for each "new line" symbol in the file, and I want these to be ignored, so I tried to put the "setIgnoringElementContentWhitespace" of the DocumentBuilderFactory to true.

The problem is that this property requires the parser to be in validating mode, and I don't have the DTD of the xml file... so I'd like it to be non validating.

Can it be done?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 26 2005
Added on Mar 29 2005
1 comment
117 views