I have 2 xml files. How can I compare both files are equal or not by using xslt? If not equal means where the changes havebeen occur in the second xml?
相关问题
- Illegal to have multiple roots (start tag in epilo
- Newtonsoft DeserializeXNode expands internal array
- how to use special characters like '<'
- XML - XSLT - document() function inside count() fu
- convert logback.xml to log4j.properties
相关文章
- Creating XML Elements without namespace declaratio
- Get Attribute Value From Simple XML Using JQuery /
- Directly signing an Office Word document using XML
- When sending XML to JMS should I use TextMessage o
- Fragment Content Overlaps Toolbar and Bottom Navig
- Getting “Error: Missing Constraints in ConstraintL
- xslt localization
- Upgrading transaction.commit_manually() to Django
In XPath 2.0 you could simple use
fn:deep-equal
.Following the same pattern in XSLT 1.0, this stylesheet:
Output:
This is the stylesheet I wrote to compare two XML files with different order in nodes and attributes. It will generate two text files, containing the ordered list of all the leaf nodes path. Use any text compare tool to spot out the differences or enhance the XSLT to do what you want.
XSLT is best used for transforming one XML dialect to another.
To compare XML files, I would use an XML parser on your platform and compare the documents using it.
It is possible to compare the two, but I would advise against it, if you have other options.