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 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?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top