public class DifferentRootElementException extends DeltaXMLProcessingException
Files being compared must have equivalent root elements. This is because it is not possible to represent files with different root elements with a delta format.
The definition of equivalence/equality for root elements is: if one element is in a namespace then the other element must be in a namespace with the same URI; additionally the localNames of the elements must be identical. Note that this does not preclude, for example, using different namespace prefixes or different use of a default namespace.
Methods are provided to report both the QNames used (which could include different prefixes) or names in the {URI}localName notation.
Note: the getErrorCode()
method is provided for compatibility with earlier XML Compare releases; when
called with this exception the result will be: 4
Constructor and Description |
---|
DifferentRootElementException(java.lang.String qName1,
java.lang.String qName2,
java.lang.String namespacedName1,
java.lang.String namespacedName2)
Construct a new DifferentRootElementException appropriate for use in the XML Compare code.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNamespacedName1()
Reports namespaced-name of the root element of the first comparison input.
|
java.lang.String |
getNamespacedName2()
Reports namespaced-name of the root element of the second comparison input.
|
java.lang.String |
getQName1()
Report the QName of the root element of the first comparison input.
|
java.lang.String |
getQName2()
Report the QName of the second comparison input root.
|
getErrorCode, getSeverity
getCause, getThrowable
public DifferentRootElementException(java.lang.String qName1, java.lang.String qName2, java.lang.String namespacedName1, java.lang.String namespacedName2)
qName1
- the QName of the root element from the first inputqName2
- the QName of the root element from the second inputnamespacedName1
- the name (in {URI}localName format) of the first input root elementnamespacedName2
- the name (in {URI}localName format) of the second input root elementpublic java.lang.String getQName1()
public java.lang.String getQName2()
public java.lang.String getNamespacedName1()
public java.lang.String getNamespacedName2()