TheCodersCorner.com items tagged with xml.

Using Java's XMLStreamReader PULL XML Parser

By dave

In this entry I show how to use the inbuilt Java XMLStreamReader PULL parser class to read an XML file. The XML stream libraries are PULL based XML parsers that do not load the whole document into a memory structure, so therefore are more suited to large volumes of XML. Below is an example XML file for a zoo, it contains...

Write XML with GroovyBuilder

By dave

Groovy supports the concept of builders, which provide an abstraction between the required output content and the representation of it. Groovy supports this by providing a tree like structure in groovy code that represents the required HTML or XML: So what have we done? We generated some HTML, in this case we just printed it to the console, but we could...

Reading XML in groovy using XmlParser

By dave

Groovy has great inbuilt xml support, and allows you to treat xml paths like objects. Reading elements and attributes is so straightforward that it was one of the factors that got me started with Groovy. So to build an object tree from xml, we just use the class. To dereference an element we use normal dot syntax, for an attribute,...

Generate an ATOM feed with GroovyBuilder

By dave

Lastly, we look at building an ATOM document using the same principles. ATOM provides a means for site owners to provide updates to site users. It works by providing an XML document showing recent changes to the site. Browsers that support RSS and RSS readers can then highlight these changes to users. An atom formatted document contains two main sections, the...

These may be of interest

We use cookies to analyse traffic and to personalise content. We also embed Twitter and Youtube on some pages, these companies have their own privacy policies.

See the privacy policy and terms of use of this site should you need more information or wish to adjust your settings.