You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(readme): enhance documentation for in-line comment position generation and update changelog for version 0.2.26
chore(XMLDiff): implement handling of in-line comments for defining position of added elements in diff
fix(RunXMLDiff.bat): improve original file path determination logic
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,11 @@ Example:
130
130
</diff>
131
131
```
132
132
133
+
#### Defining the position generation for the diff by in-line comment
134
+
135
+
The `pos` attribute of the `add` usually is set to `after`, taking in account the common logic of how the program is working. But in some cases, you may want to have a diff file with the `pos` attribute set to `before`. Mostly it is useful when it working in conjunction with the vscode - [XMLDiff with VSCode](forVSCode/XMLDIffwithVSCode.md).
136
+
From version 0.2.26, you can define the position of the `add` element in the diff file by using an in-line comment in the original XML file. The comment should be placed before the element you want to add and should contain the text `<!-- pos="before" -->`.
137
+
133
138
### How to apply a diff file
134
139
135
140
There is a command line helpfor the `XMLPatch` tool:
@@ -270,6 +275,11 @@ Please be aware - each release archive has an appropriate link to the [VirusTota
270
275
271
276
## Changelog
272
277
278
+
### [0.2.26] - 2025-06-16
279
+
280
+
- Improved:
281
+
- Added in-line comments processing forthe `add` elementsin the modified XML file. It allows to define the position attribute of the `add` element in the diff file.
$"[Operation Add] Element '{GetElementInfo(addedChild)}' with pos=before to parent '{GetElementInfo(originalElem)}'."
760
+
);
761
+
}
762
+
else
763
+
{
764
+
// Fall back to the regular add operation if XPath contains numeric IDs
765
+
addOp.Add(addedChild);
766
+
Logger.Info(
767
+
$"[Operation Add] Element '{GetElementInfo(addedChild)}' to parent '{GetElementInfo(originalElem)}' (pos=before comment found but using regular add due to numeric XPath)."
768
+
);
769
+
}
770
+
}
771
+
else
772
+
{
773
+
// Use the regular add operation
774
+
addOp.Add(addedChild);
775
+
Logger.Info($"[Operation Add] Element '{GetElementInfo(addedChild)}' to parent '{GetElementInfo(originalElem)}'.");
$"[Operation add] Element '{GetElementInfo(addedChild)}' with pos=before to parent '{GetElementInfo(originalElem)}'."
850
+
);
851
+
}
852
+
else
853
+
{
854
+
// Fall back to the regular add operation if XPath contains numeric IDs
855
+
addOp.Add(addedChild);
856
+
Logger.Info(
857
+
$"[Operation add] Element '{GetElementInfo(addedChild)}' to parent '{GetElementInfo(originalElem)}' (pos=before comment found but using regular add due to numeric XPath)."
858
+
);
859
+
}
860
+
}
861
+
else
862
+
{
863
+
// Use the regular add operation
864
+
addOp.Add(addedChild);
865
+
Logger.Info($"[Operation add] Element '{GetElementInfo(addedChild)}' to parent '{GetElementInfo(originalElem)}'.");
Copy file name to clipboardExpand all lines: forVSCode/XMLDIffwithVSCode.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,32 +27,33 @@ This document describes how to use XMLDiff with Visual Studio Code.
27
27
│ md.original
28
28
```
29
29
30
-
2. You can script creation `*.original` folders, if you will use the `extracted` files folder.
30
+
2. You can skip creation `*.original` folders, if you will use the `extracted` files folder.
31
31
3. Copy the [RunXMLDiff.bat](/forVSCode/RunXMLDiff.bat) file to the root of your project.
32
32
4. Copy the `XMLDiff.exe` file to the `XMLDiffAndPatch` folder in the root of your project.
33
33
5. Install the VSCode extension [Run on Save](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave) by [emeraldwalk](https://marketplace.visualstudio.com/publishers/emeraldwalk)
34
34
6. Open the settings of the extension by pressing `Ctrl + ,` and search for `runOnSave.commands`
35
35
7. Add the following configuration to the settings:
36
36
7.1 In case of not to use the "Extracted" files folder, i.e. with `*.original` folders:
0 commit comments