java - SAX - HTML attribute with no value -
i using sax parse html. however, have parse document has this:
`<option value="123" selected>`
and because selected not have actual value set, throwing error (not well-formed, invalid token). there way resolve can keep using sax?
my code:
saxparserfactory spf = saxparserfactory.newinstance(); saxparser sp = spf.newsaxparser(); xmlreader xr = sp.getxmlreader(); xr.setcontenthandler(sch); inputsource = new inputsource(statics.subject_code_url); xr.parse(is);
you can't use sax parse html. html not xml. valid html document not valid xml document, , nothing can make xml parser parse it.
Comments
Post a Comment