Re: SAX Parser includes ignorable whitespaces in the character() method
Michael Glavassevich <[email protected]>
| Newsgroups | gmane.text.xml.xerces-j.user |
|---|---|
| Message-ID | <OFC302A687.B8BCBA83-ON85257D51.005172D0-85257D51.0051E061@ca.ibm.com> |
Your XML document requires a DTD with element declarations which specify that they contain element-only content. Without that a SAX parser cannot determine which whitespaces are 'ignorable'. Thanks. Michael Glavassevich XML Technologies and WAS Development IBM Toronto Lab E-mail: [email protected] E-mail: [email protected] "Zhu, Joe" <[email protected]> wrote on 09/11/2014 07:00:11 PM: > I am writing an app which need to access all text content in XML. > According to the ContentHandler API, this could be accomplished by > using a validating parser and the characters() method. > > But with the Xerces parser, the characters() method could contain > ignorable whitespaces (XML formatting whitespaces). I have no way to > tell if the whitespace is ignorable whitespace or is part of the XML content. > > Has anybody else run into the problem? I tested with both Xerces 2. > 9.1 and Xerces 2.11. They behave the same way. > > Joe Zhu