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!

SAX parser PreservingElementContentWhitespace

843834Dec 21 2004 — edited Dec 21 2004
Hai,

I would like to know if there is a method by which the white space in the can be preserved while parsing an xml document. In dom parser it is possible by using the method
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setIgnoringElementContentWhitespace(true);
DocumentBuilder db = dbf.newDocumentBuilder();
db.parse(in);

In a similar way I would like to know wether the white space content can be preserved using a SAX parser. I am getting the sax parser to parse the xml document the foillowing way...

XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
reader.setContentHandler(new DbPaymentSAXConverter(listDestinations));
reader.parse(strInputFile);

Thanking you in advance

rgds,
Satish
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2005
Added on Dec 21 2004
2 comments
244 views