Read an org.jdom.Document object with groovy



I have an org.jdom.Document object that I'd like to process using groovy XMLSlurper.


I am currently using the following code:



// doc is my org.jdom.Document object
new XMLSlurper().parseText(new XMLOutputter().outputString(doc));


The conversion from Document to String takes some time. Is there any better alternative to avoid the conversion in order to speedup the execution?


No comments:

Post a Comment