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 < &lt; , > &gt; or wrap whole <to/> , <from/> content <![cdata[ ]]> block...


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -