Class UnorderedDuplicateKeysException

All Implemented Interfaces:
Serializable

public class UnorderedDuplicateKeysException extends DeltaXMLProcessingException

An orderless element (one with the deltaxml:ordered='false' attribute) cannot contain more than one child element with the same name/type (ie. the same namespace URI and localName) and the same deltaxml:key attribute value.

This exception is thrown whenever two such elements are found within the same orderless parent. There may be more than two child elements with the same key value, but only two are reported with an exception within any parent element and key value combination.

Note: the getErrorCode() method is provided for compatibility with earlier XML Compare releases; when called with this exception the result will be: 46

Since:
5.0
See Also:
  • Constructor Details

    • UnorderedDuplicateKeysException

      public UnorderedDuplicateKeysException(String parentElement, String keyValue, String child1, String child2)
      Construct a new UnorderedDuplicateKeysException appropriate for use with the XML Compare code. Most parameters have their default values.
      Parameters:
      parentElement - String used to represent the XPath of the erroneous element.
      keyValue - the value of the duplicated deltaxml:key attribute
      child1 - one of the children with duplicate keys
      child2 - another child with duplicate keys
  • Method Details

    • getIncorrectParentElement

      public String getIncorrectParentElement()
      Reports the XPath of the orderless element.
      Returns:
      a String corresponding to the XPath of the orderless element containing multiple children with the same key.
    • getKeyValue

      public String getKeyValue()
      Reports the shared key value.
      Returns:
      the value of the deltaxml:key attribute which is shared by two or more children
    • getChild1

      public String getChild1()
      Reports the location (XPath) of the first shared-key child.
      Returns:
      a string corresponding to the XPath of the first child with the shared key.
    • getChild2

      public String getChild2()
      Reports the location (XPath) of the second shared-key child.
      Returns:
      a string corresponding to the XPath of the another child with the shared key.