Changes for page Diff Module

Last modified by Michael Hamann on 2023/07/26 16:06

<
From version < 12.1 >
edited by Simon Urli
on 2019/08/19 18:19
To version < 13.1 >
edited by Marius Dumitru Florea
on 2019/12/11 15:55
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.surli
1 +xwiki:XWiki.mflorea
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -181,23 +181,27 @@
181 181  
182 182  == Displaying the Changes ==
183 183  
184 -To display the changes you need to use the ##XMLDiffMarker## and ##XMLDiffPruner## components like this:
184 +To compute and display the changes you can use the ##XMLDiffManager## component.
185 185  
186 186  {{code language="java"}}
187 -// Compute the changes and mark them in the previous document (e.g. using special attributes and elements).
188 -if (xmlDiffMarker.markDiff(previousDocument, nextDocument)) {
189 - // Hide nodes that have not changed.
190 - xmlDiffPruner.prune(previousDocument);
191 - // Serialize previous document.
192 - ...
193 -} else {
194 - // No changes detected.
187 +public interface XMLDiffManager
188 +{
189 + /**
190 + * Computes and marks the differences between two XML documents.
191 + *
192 + * @param left the left side of the comparison
193 + * @param right the right side of the comparison
194 + * @param config the configuration
195 + * @return the differences between the two XML documents
196 + * @throws DiffException if the difference can't be computed
197 + */
198 + String diff(String left, String right, XMLDiffConfiguration config) throws DiffException;
195 195  }
196 196  {{/code}}
197 197  
198 198  === HTML Visual Diff ===
199 199  
200 -Both ##XMLDiffMarker## and ##XMLDiffPruner## have implementations dedicated to computing a visual diff on HTML. Best is to use the provided script service:
204 +The ##XMLDiffManager## has an implementation dedicated to computing a visual diff on HTML. Best is to use the provided script service:
201 201  
202 202  {{code language="none"}}
203 203  <div class="html-diff">

Get Connected