diffFile should allow to exclude attribute values
Are you missing a feature? Request its implementation here.
-
- Posts: 2
- Joined: Thu Mar 06, 2025 7:13 pm
diffFile should allow to exclude attribute values
Post by moisesalvarez »
Hello,
The diffFIle tool allows to diff xml files and bypass certain verifications in order to focus more on node construction more than values, like excluding node text, attribute order, etc. but it is not a possible option to exclude attribute values from diff action.
Request: Add attribute values to XML diff ignore.
Thank you in advance.
The diffFIle tool allows to diff xml files and bypass certain verifications in order to focus more on node construction more than values, like excluding node text, attribute order, etc. but it is not a possible option to exclude attribute values from diff action.
Request: Add attribute values to XML diff ignore.
Thank you in advance.
-
- Posts: 81
- Joined: Wed Aug 30, 2017 3:56 pm
Re: diffFile should allow to exclude attribute values
Hello,
You can ignore attribute values from comparison if you use the Ignore nodes by XPath option.
Consider the two sample XML files below:
personal.xml
personal-new.xml
In the text field enabled by checking the Ignore nodes by XPath option, fill in the following XPath expression: person/(@id | @photo)
When comparing the file pair, the provided XPath expression is taken into account and no differences are highlighted.
If you disable the Ignore nodes by XPath option and compare again, 4 differences are now highlighted because the values of the id and photo attributes are different in the 2 compared files.
Note that the Ignore nodes by XPath option is also considered when comparing directories using the Compare Directories tool.
Best regards,
Teo
You can ignore attribute values from comparison if you use the Ignore nodes by XPath option.
Consider the two sample XML files below:
personal.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<personnel>
<person id="harris.anderson" photo="personal-images/harris.anderson.jpg">
<name>Harris Anderson</name>
<email>harris.anderson@example.com</email>
</person>
<person id="robert.taylor" photo="personal-images/robert.taylor.jpg">
<name>Robert Taylor</name>
<email>robert.taylor@example.com</email>
</person>
</personnel>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<personnel>
<person id="harris.anderson.new" photo="personal-images/harris.anderson.new.jpg">
<name>Harris Anderson</name>
<email>harris.anderson@example.com</email>
</person>
<person id="robert.taylor.new" photo="personal-images/robert.taylor.new.jpg">
<name>Robert Taylor</name>
<email>robert.taylor@example.com</email>
</person>
</personnel>
When comparing the file pair, the provided XPath expression is taken into account and no differences are highlighted.
If you disable the Ignore nodes by XPath option and compare again, 4 differences are now highlighted because the values of the id and photo attributes are different in the 2 compared files.
Note that the Ignore nodes by XPath option is also considered when comparing directories using the Compare Directories tool.
Best regards,
Teo
Teodor Timplaru
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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