简体   繁体   中英

SAX parser in java

can SAX parser handle self closing tag? or will it cause an error? eg <br/> or <hr/>

<br/> or <hr/>

are called empty tags. SAX parser will not give an error.

If you're using the SAX parser in XML rather than HTML mode then yes, it can handle self-closing tags. Note: self-closing tags are valid XML but technically not valid HTML.

Valid HTML: <br> <div></div>

Valid XML: <br/> <div></div> <div/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM