开发者

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/>.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜