java - Is there a way to get SAXParser to ignore content of certain elements when parsing? -
i have xml of format:
... <to>"paul mccartney" <paul.mccartney@hotmail.com></to> <from>"john lennon" <john.lennon@yahoo.com></from> ... the saxparser throws exception gets email addresses. thinks <paul.mccartney@hotmail.com> xml element , throws , exception encounters @ symbol. there anyway ignore content of elements in java sax?
you try overriding org.xml.sax.helpers.defaulthandler.error(), , similar methods, if you're using defaulthandler? see javadoc of org.xml.sax.errorhandler:
http://download.oracle.com/javase/6/docs/api/org/xml/sax/errorhandler.html
but in way, xml invalid. shouldn't way. preprocess , replace < < , > > or wrap whole <to/> , <from/> content <![cdata[ ]]> block...
Comments
Post a Comment