XML Matcher logo

SourceForge.net Logo

Overview

XML Matcher is a small Java library for matching XML documents with templates. It was designed for automated testing of XML APIs (e.g. Web Services). 

Take a look at the following three examples:


<location>
    <x xm:tolerance='0.01'>-72.98</x>
    <y xm:tolerance='0.01'>42.52</y>
</location>

Template defines tolerance for matching floating point values with actual document.

Namespace prefix 'xm' annotates internal elements and attributes of XML-Matcher.
<person xm:regex-dom="true">
  <xm:choice>
    <nickname>C.A.R.</nickname>
    <xm:group>
      <first>Tony</first>
      <last>Hoare</last>
    </xm:group>
  </xm:choice>
</person>


This template uses regular expressions notation adapted for XML. It will match with actual document where person is defined either by nickname (C.A.R) or using first and last name (Tony Hoare). 

More about regular expressions  in XML Matcher here.
<?javascript asserts.equals ("step[1]", "step[last()]"); ?>
This template uses Javascript processing instructions to assert that values of the first and last step elements are the same.

Complete set of constructs available in XML template is described in Reference Guide.

Features

Limitations

Resources



Written by Andy Malakov.
Special thanks to Gene Florintsev for the idea of adapting Regex to XML matching.
This library includes software developed by The Apache Software Foundation and Mozilla project.