Changes for page Diff Module
Last modified by Michael Hamann on 2023/07/26 16:06
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -xwiki:XWiki. surli1 +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 n eedtouse 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## haveimplementationsdedicated 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">