Skip to content

Fix XmlPatch attribute selector matching on intermediate nodes#13

Merged
elementgreen merged 1 commit intoKymorphia:masterfrom
dejlek:dejan/xmlpatch-fix
Feb 16, 2026
Merged

Fix XmlPatch attribute selector matching on intermediate nodes#13
elementgreen merged 1 commit intoKymorphia:masterfrom
dejlek:dejan/xmlpatch-fix

Conversation

@dejlek
Copy link
Copy Markdown
Contributor

@dejlek dejlek commented Feb 15, 2026

The selAttrId was incorrectly checked on all nodes in the selector path instead of only the final target node, causing rename attribute operations with multi-level selectors to fail.

If we leave the unittest without these changes we get:

xml_patch.XmlPatchError@source/xml_patch.d(469): XML patch selector 'root.child[test]' did not match
----------------
??:? _d_createTrace [0x7fdac3933acf]
??:? _d_throw [0x7fdac3926f90]
source/xml_patch.d:247 void xml_patch.XmlPatch.apply(xml_tree.XmlTree, xml_tree.XmlNode) [0x415b48]
source/xml_patch.d:482 void xml_patch.__unittest_L473_C1() [0x6005a3]
source/xml_patch.d:484 void xml_patch.__modtest() [0x6005bb]

The selAttrId was incorrectly checked on all nodes in the selector
path instead of only the final target node, causing rename attribute
operations with multi-level selectors to fail.
@elementgreen elementgreen merged commit 57b1d12 into Kymorphia:master Feb 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants