public final class Extension extends Object
In Saxon, declare the namespace as:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:diffx="com.topologi.diffx.Extension"
extension-element-prefixes="diffx"
>
Diff-X can be called within XSLT with:
<xsl:copy-of select="diffx:diff(/node1/to/compare, /node2/to/compare, 'IGNORE', 'TEXT')"/>
Note: the method signatures requires DOM arguments, include the Saxon-DOM
jar
on your classpath to use this extension function with Saxon.Constructor and Description |
---|
Extension() |
Modifier and Type | Method and Description |
---|---|
static Node |
diff(Node xml1,
Node xml2,
String whitespace,
String granularity)
Compares the two specified
Node s and returns the diff as a node. |
public static Node diff(Node xml1, Node xml2, String whitespace, String granularity) throws DiffXException, IOException
Node
s and returns the diff as a node.
Only the first node in the node list is sequenced.
xml1
- The first XML node to compare.xml2
- The second XML node to compare.whitespace
- The white space processing (a valid WhiteSpaceProcessing
value).granularity
- The text granularity (a valid TextGranularity
value).DiffXException
- Should a Diff-X exception occur.IOException
- Should an I/O exception occur.Copyright © 2007-2018. All Rights Reserved.