Skip to content

banshooter/xml-compare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xml-compare: XML Compare

xml-compare is a Java library for comparing 2 XMLs with condition to ignore sequence of children nodes and sequence of attributes.

xml-compare implemented by customized lexer and parser from scratch without any additional library, so its jar package is very small.

xml-compare is mainly built for using in unit tests to comparing 2 XMLs and also as an example of simple and stupid lexer and parser of XML.

Example

add this in project's pom.xml:

<dependency>
  <groupId>com.jarunj.xml</groupId>
  <artifactId>xml-compare</artifactId>
  <version>0.7.3</version>
</dependency>
import com.jarunj.xml.XML;
.
.
.
XML xml1 = new XML("<ns:Legacies><Legacy version=\"3.0.0\" year=10>a lot of them<Legacy><ns:Legacies>");
XML xml2 = new XML("<ns:Legacies><Legacy year=10 version=\"3.0.0\">a lot of them<Legacy><ns:Legacies>");
assert(xml1.equals(xml2)); // not throw Exception

About

java library to compare xml in unit test

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages