How to configure the Nekohtml html parser to turn <br> into <br />
I'm evaluating the Nekothml parse开发者_StackOverflow中文版r among other Java HTML parsers, and I'm trying to make it replace all my <br>
with <br />
elements. Can this be done using the Nekohtml API?
Any feedback is appreciated.
Thanks.
The nekohtml parser is a parser. It produces a DOM tree or SAX events, all in memory, not text. If you have configured it properly, it will read the html <br> as if it were an empty XML element, and any XML serialization will them produce <br/>.
精彩评论