Class XmlDocument

java.lang.Object
org.codice.ddf.itests.common.XmlDocument

public class XmlDocument extends Object
Simpler helper class for creating document object models (DOM) searches. The purpose is to reduce the amount of duplicated code used in the test classes.

This class is not thread-safe. It not optimized-- it creates new factories and builders for every invocation. It is not suitable for use in production code.

This class does not catch errors. It passes errors up the call chain to provide developers with the most information possible when debugging test cases.

To format (pretty print) XML, use the ddf.util.XPathHelper or org.codice.ddf.platform.util.XMLUtils classes.

  • Method Details

    • build

      public static Document build(String input, boolean isNamespaceAware) throws Exception
      Create an DOM from a string representation of an XML document.
      Parameters:
      input - string that represents an XML document
      isNamespaceAware - true or false
      Returns:
      Throws:
      Exception
    • build

      public static Document build(String input) throws Exception
      Create an DOM from a string representation of an XML document. The document builder is namespace aware.
      Parameters:
      input - string that represents an XML document
      Returns:
      Throws:
      Exception