문제

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