Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This example assumes the following class is already on your CLASSPATH:

XmlExamples.groovy

Here is an example of using DOM4J with Groovy to process an existing XML file:

DOM4J also supports a streaming mode which lets you manually prune parts of the DOM tree during processing to facilitate processing large documents. Here is an example which uses DOM4J in that mode:

We could have also performed a hybrid approach which pruned away parts of the tree we weren't interested in and then performed tree-walking/navigation style coding after that.

  • No labels