Tag: xml
XMLUnit: JUnit and NUnit testing for XML
http://xmlunit.sourceforge.net/
XMLUnit allows you to make assertions about XML documents. Take a look at some example code here.
XMLBeam: Java library to project parts of a XML DOM tree into Java objects via XPath instead of using data binding
I haven’t tried this, but it looks interesting. It seems to be designed to
help break the dependency between the XML structure and the structure of your
code. With most data binding libraries, you either make your api mirror the
structure of the XML, or you transform the data to match your API. This lets
you map data from the XML directly onto Java objects using XPath and
annotations.
Take a look at the XMLBeam introduction page.
Access XML data directly via XPath-annotated Java interfaces:
<xml>
<example>
<content type="foo" >bar</content>
</example>
</xml>
public interface Example {
@XBRead("/xml/example/content")
String getContent();
@XBRead("/xml/example/content/@type")
String getType();
}