getPCDATA() calls return extra breaks
Brought to you by:
jnerd
The getPCDATA() call always returns extra
\n \t and whitespaces. To resolve when you
automatically generate the XMLHandler please
add
this.sb = null;
to the startElement()
and the endElement()
functions.
public void startElement(String uri,String
localName,String qName,Attributes attributes)
throws SAXException {
this.sb =null; //add this line for fix
this.processPCData();
this.getSubHandler(localName).startElement
(uri,localName,qName,attributes);
}
public void endElement(String uri,String
localName,String qName) throws SAXException {
this.processPCData();
((SubHandler) this.stack.peek()).endElement
(uri,localName,qName);
this.sb =null; //add this line for fix
}
Thanks
Inxightfool
Logged In: YES
user_id=936665
By accident I observed the same error and found a different
behavior between a just well-formed and a valid xml-file.
e.g. the difference was the missing DOCTYPE-statement in the
first case. May be that helps, too.