Method Summary |
|
public static Document | buildControlDocument(String fromXML) Utility method to build a Document using the control DocumentBuilder
to parse the specified String. |
public static Document | buildControlDocument(InputSource fromSource) |
public static Document | buildDocument(DocumentBuilder withBuilder, Reader fromReader) Utility method to build a Document using a specific DocumentBuilder
and reading characters from a specific Reader. |
public static Document | buildDocument(DocumentBuilder withBuilder, InputSource fromSource) |
public static Document | buildTestDocument(String fromXML) Utility method to build a Document using the test DocumentBuilder
to parse the specified String. |
public static Document | buildTestDocument(InputSource fromSource) |
public static Diff | compareXML(InputSource control, InputSource test) |
public static Diff | compareXML(Reader control, Reader test) |
public static Diff | compareXML(String control, Reader test) |
public static Diff | compareXML(Reader control, String test) |
public static Diff | compareXML(String control, String test) |
public static Diff | compareXML(Document control, Document test) |
public static DocumentBuilderFactory | getControlDocumentBuilderFactory() Get the DocumentBuilderFactory instance used to instantiate
parsers for the control XML in an XMLTestCase. |
public static EntityResolver | getControlEntityResolver() Obtains the EntityResolver to be added to all new control parsers. |
public static DocumentBuilder | getControlParser() Get the DocumentBuilder instance used to parse the test XML
in an XMLTestCase. |
public static boolean | getIgnoreAttributeOrder() Whether to ignore the order of attributes on an element.
The order of attributes has never been relevant for XML
documents, still XMLUnit will consider two pieces of XML
not-identical (but similar) if they differ in order of
attributes. |
public static boolean | getIgnoreComments() Whether comments should be ignored. |
public static boolean | getIgnoreDiffBetweenTextAndCDATA() Whether CDATA sections and Text nodes should be considered the same. |
public static boolean | getIgnoreWhitespace() Whether to ignore whitespace when comparing node values. |
public static boolean | getNormalize() Whether Text nodes should be normalized. |
public static boolean | getNormalizeWhitespace() Whether whitespace characters inside text nodes or attributes
should be "normalized". |
public static SAXParserFactory | getSAXParserFactory() Get the SAX parser to use in tests. |
public static Transform | getStripCommentsTransform(Document forDocument) Obtain the transformation that will strip comments from a DOM. |
public static Transform | getStripWhitespaceTransform(Document forDocument) |
public static DocumentBuilderFactory | getTestDocumentBuilderFactory() Get the DocumentBuilderFactory instance used to instantiate
parsers for the test XML in an XMLTestCase. |
public static DocumentBuilder | getTestParser() Get the DocumentBuilder instance used to parse the test XML
in an XMLTestCase. |
public static TransformerFactory | getTransformerFactory() Get the transformer to use for XSLT transformations (and by
implication serialization and XPaths). |
public static URIResolver | getURIResolver() Gets the URIResolver used during Transformations. |
public static String | getVersion() Place holder for current version info. |
public static String | getXPathFactory() Gets the class to use as XPathFactory when using JAXP 1.3. |
static String | getXSLTStart() XSLT stylesheet element using the configured XSLT version. |
public static String | getXSLTVersion() The XSLT version set on stylesheets used internally. |
public static NamespaceContext | getXpathNamespaceContext() Get the NamespaceContext to use in XPath tests. |
public static DocumentBuilder | newControlParser() Get the DocumentBuilder instance used to parse the control
XML in an XMLTestCase. |
public static DocumentBuilder | newTestParser() Get the DocumentBuilder instance used to parse the test XML
in an XMLTestCase. |
public static XpathEngine | newXpathEngine() Obtains an XpathEngine to use in XPath tests. |
public static void | setControlDocumentBuilderFactory(DocumentBuilderFactory factory) Override the DocumentBuilderFactory used to instantiate
parsers for the control XML in an XMLTestCase. |
public static void | setControlEntityResolver(EntityResolver resolver) Sets an EntityResolver to be added to all new control parsers. |
public static void | setControlParser(String className) Overide the DocumentBuilder to use to parse control documents.
This is useful when comparing the output of two different
parsers. |
public static void | setIgnoreAttributeOrder(boolean b) Whether to ignore the order of attributes on an element.
The order of attributes has never been relevant for XML
documents, still XMLUnit will consider two pieces of XML
not-identical (but similar) if they differ in order of
attributes. |
public static void | setIgnoreComments(boolean b) Whether comments should be ignored. |
public static void | setIgnoreDiffBetweenTextAndCDATA(boolean b) Whether CDATA sections and Text nodes should be considered the same. |
public static void | setIgnoreWhitespace(boolean ignore) Whether to ignore whitespace when comparing node values. |
public static void | setNormalize(boolean b) Whether Text nodes should be normalized.
The default value is false
Note: if you are only working with documents read
from streams (like files or network connections) or working
with strings, there is no reason to change the default since
the XML parser is required to normalize the documents. |
public static void | setNormalizeWhitespace(boolean b) Whether whitespace characters inside text nodes or attributes
should be "normalized". |
public static void | setSAXParserFactory(String className) Override the SAX parser to use in tests. |
public static void | setTestDocumentBuilderFactory(DocumentBuilderFactory factory) Override the DocumentBuilderFactory used to instantiate
parsers for the test XML in an XMLTestCase. |
public static void | setTestEntityResolver(EntityResolver resolver) Sets an EntityResolver to be added to all new test parsers. |
public static void | setTestParser(String className) Overide the DocumentBuilder to use to parser test documents.
This is useful when comparing the output of two different
parsers. |
public static void | setTransformerFactory(String className) Overide the transformer to use for XSLT transformations (and by
implication serialization and XPaths). |
public static void | setURIResolver(URIResolver resolver) Sets the URIResolver to use during transformations. |
public static void | setXPathFactory(String className) Sets the class to use as XPathFactory when using JAXP 1.3. |
public static void | setXSLTVersion(String s) Sets the XSLT version to set on stylesheets used internally. |
public static void | setXpathNamespaceContext(NamespaceContext ctx) Set the NamespaceContext to use in XPath tests. |