swan is a suite of Java-based tools for working with XML. The focus is on a hybridized model that blends pattern-based and event-based models for XML processing, as well as supporting the leading tree-based models (DOM, JDOM, dom4j, XOM, etc.).
Be the first to post a text review of swan. Rate and review a project by clicking thumbs up or thumbs down in the right column.
Swan is a suite of Java-based tools for XML processing. The Swan Output library is a subset of the Swan suite that provides an API with a simple, readable syntax for programmatically generating XML output. The output is generated using standard SAX event handlers. To get a flavor of what this API affords the developer, consider the following snippet of XML: <department> <employee id="500"> <firstName>Kilgore</firstName> <lastName>Trout</lastName> </employee> </department> The code to produce this directly using SAX would be quite ugly and verbose, in spite of the simplicity of the markup being produced. Code to produce this using this API, though, could look something like this: ResultFactory factory = new ResultFactory(); DocumentResult result = factory.newDocumentResult(new StreamResult(System.out)); ElementResult dept = result.element("department"); ElementResult emp = dept.element("employee") emp.attribute("id", "500"); emp.element("firstName").text("Kilgore"); emp.element("lastName").text("Trout"); // output the accumulated result tree result.end(); Swan output can be downloaded from the project's website: http://sourceforge.net/projects/swan
Be the first person to add a text review.
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?