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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -