ApacheCon US 2008 Session

XML and Web Services with Groovy

Groovy provides excellent facilities for parsing and creating XML. As well as providing syntactic sugar on top of traditional Java-based parsing approaches (e.g. SAX, DOM, StAX), it has its own XmlParser and XmlSlurper libraries which support XPath-like expressions at the object level (akin to LINQ in the .Net world). It also integrates nicely with XPath, XQuery, XSLT as well as with popular XML libraries. Groovy's markup builders provide an elegant and efficient way to create and modify XML. All these features can work with Apache Xerces or with native XML support on 1.4 through to 1.7 JVMs. In addition to its base XML capabilities, Groovy modules exist for doing XML-RPC, REST and SOAP Web Services including RSS, ATOM and other popular XML dialects. Groovy-WS is based on Apache CXF and provides a simple and elegant way to create Web Services without the need for worrying about stubs.