开发者

Jsoup vs groovy XmlSlurper?

开发者 https://www.devze.com 2023-04-06 13:05 出处:网络
I am looking at parsing some xml content for my application (based on groovy) and I am stuck at this point where I have to choose between JSoup and groovy\'s native XMLSlurper.

I am looking at parsing some xml content for my application (based on groovy) and I am stuck at this point where I have to choose between JSoup and groovy's native XMLSlurper.

RSS Feeds parsed are of medium size not exceeding more than 25 items. So the size开发者_如何学C of the content being parsed is neither too much nor too less.

Although the content is of medium size, parsing of content happens several times. So in terms of overhead and speed, which of the two is a better choice?


For parsing 25 items, I wouldn't worry about it too much.

I'd use XmlSlurper first, as it doesn't add a dependency to your project and is integrated tightly into Groovy, but then consider other options if for some reason it does not work as well as expected


XmlSlurper. TagSoup is really for the vagaries of HTML.

Pretty easy to do a speed comparison though, no?

0

精彩评论

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

关注公众号