DevKits

XML Diff — Structural Compare of Two XML Documents

Compare two XML documents structurally — elements, attributes, and text content. Ignores comments, whitespace, and attribute order. Uses the same path convention as our XML → JSON converter (@attr, #text). 100% local.

Last updated:

Comments
342 chars · 13 lines
396 chars · 14 lines

Path convention: attributes are shown as @attr, text content as #text — same as our XML → JSON converter, so paths can be pasted into other JSON tools.

Added1Removed0Changed5Type changed0Unchanged6
ChangePathLeftRight
Changed$.invoice["@currency"]"USD""EUR"
Changed$.invoice.customer.name"Ada Lovelace""Ada King"
Changed$.invoice.items.item[0].price"19.99""17.50"
Changed$.invoice.items.item[1].price"49.00""45.00"
Added$.invoice.items.item[2]{"@sku":"C9","qty":"3","price":"5.00"}
Changed$.invoice.total"88.98""95.00"

Frequently Asked Questions

How does the tool handle attribute order and whitespace?

Attributes are compared as an unordered set (attribute order in XML has no semantic meaning). Whitespace between tags is normalized. Only meaningful content differences — element added/removed, attribute value changed, text content changed — are reported.

What is the path syntax in the results?

It matches our XML → JSON conversion. Attributes appear as @attr, text nodes as #text, elements as their tag names. So $.invoice["@currency"] means the currency attribute on the top-level invoice element. You can paste any path into other JSON-focused tools without translation.

Are XML namespaces handled?

Namespaced tags are compared using their full prefixed name (e.g. soap:Envelope). If you only care about local names, strip the namespace prefixes in a formatter before diffing.

Related Tools