简体   繁体   中英

Comparing two instances of XML for changes

I have a requirement where i want to keep/track changes to base XML document . For this i have to figure out a most efficient way to keep track of all the changes done to the base XML structure and keep those changes in a different fomat(xml). My input source can be of both type that is SAX and DOM .How can I achieve this ?

XMLUnit has exactly this functionality:

XMLTestCase.compareXML() has both DOM and SAX versions. Use DetailedDiff to get a list of all differences between the two XMLs. Convert this diff object to your own representation if needed.

XMLUnit is nice because it can treat similar XML documents (such as whitespace, sibling order, namespace prefixes) as the same if you want.

DeltaXML是一种可能在XML差异方面完成您想要的所有事情的商业产品。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM