Compare XML equivalence
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 2
- Joined: Wed Jan 25, 2017 11:49 am
Compare XML equivalence
Post by jantimmerman »
There's some discussion going on and I am tasked to prove beyond doubt that two files are 'XML equivalent'. One of them has all namespace declarations on the root element and a global namespace. The other has the namespaces distributed and all elements are prefixed with a namespace (the global namespace is suddenly named 'tag0').
I am pretty sure the xml files are equivalent, but sadly Oxygen compare seems to be unable to ignore the location of namespace declarations.
Is there another way to do this? I am currently using 'Oxygen editor 16.1'. Will upgrading help in any way?
Example
File A:
File B:
These files are not equivalent according to Oxygen compare, even if I use the 'XML Accurate' setting in the Oxygen compare tool.
I am pretty sure the xml files are equivalent, but sadly Oxygen compare seems to be unable to ignore the location of namespace declarations.
Is there another way to do this? I am currently using 'Oxygen editor 16.1'. Will upgrading help in any way?
Example
File A:
Code: Select all
<Response-APD xmlns="http://www.kadaster.nl/schemas/requests-apd/v200909" xmlns:ns2="http://www.kadaster.nl/schemas/requests-selections/v200909">
<response>
<request>
<ns2:APD>
File B:
Code: Select all
<tag0:Response-APD xmlns:tag0="http://www.kadaster.nl/schemas/requests-apd/v200909">
<tag0:antwoord>
<tag0:vraag>
<ns2:APD xmlns:ns2="http://www.kadaster.nl/schemas/requests-selections/v200909">
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Compare XML equivalence
Hi,
Note that setting these does not ignore the actual namespaces (there's a different option for that, Namespaces), it only ignores the differences in prefixes and in namespace declarations.
Later Edit: I forgot to mention that these options only apply to XML algorithms (XML Fast and XML Accurate).
Regards,
Adrian
This already works in v16.1. You need to set two options in Options > Preferences, Diff > Files Comparison, XML Diff section, Ignore: Prefixes, Namespace declarations.I am pretty sure the xml files are equivalent, but sadly Oxygen compare seems to be unable to ignore the location of namespace declarations.
Is there another way to do this? I am currently using 'Oxygen editor 16.1'.
Note that setting these does not ignore the actual namespaces (there's a different option for that, Namespaces), it only ignores the differences in prefixes and in namespace declarations.
Later Edit: I forgot to mention that these options only apply to XML algorithms (XML Fast and XML Accurate).
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Wed Jan 25, 2017 11:49 am
Re: Compare XML equivalence
Post by jantimmerman »
Hi Adrian,
Thanks for your reply. This works partially.
It ignores now the additional toplevel namespace declarations. But sadly the namespaces inside the document are still marked as 'different'.
For some reason it does work if I also select the 'ignore text' button. Which was enough for my purpose as I knew that the files were identical on content level.
Files here:
http://pastebin.com/WJgjK8Qj
http://pastebin.com/abkkARnJ
Thanks for your reply. This works partially.
It ignores now the additional toplevel namespace declarations. But sadly the namespaces inside the document are still marked as 'different'.
For some reason it does work if I also select the 'ignore text' button. Which was enough for my purpose as I knew that the files were identical on content level.
Files here:
http://pastebin.com/WJgjK8Qj
http://pastebin.com/abkkARnJ
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Compare XML equivalence
Hi,
Thank you for the samples. You are right. On the given example, the namespace declarations from inner elements are still marked as different.
I've logged this on our issue tracking tool to be addressed in a future version.
Regards,
Adrian
Thank you for the samples. You are right. On the given example, the namespace declarations from inner elements are still marked as different.
I've logged this on our issue tracking tool to be addressed in a future version.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service