Class WhitespaceNormalizedSource

  • All Implemented Interfaces:
    javax.xml.transform.Source

    public class WhitespaceNormalizedSource
    extends javax.xml.transform.dom.DOMSource
    A source that is obtained from a different source by removing all empty text nodes and normalizing the non-empty ones.

    "normalized" in this context means all whitespace characters are replaced by space characters and consecutive whitespace characters are collapsed.

    • Field Summary

      • Fields inherited from class javax.xml.transform.dom.DOMSource

        FEATURE
    • Constructor Summary

      Constructors 
      Constructor Description
      WhitespaceNormalizedSource​(javax.xml.transform.Source originalSource)
      Creates a new source that consists of the given source with all whitespace characters replaced by spaces and consecutive whitespace characters collapsed.
      WhitespaceNormalizedSource​(javax.xml.transform.Source originalSource, javax.xml.parsers.DocumentBuilderFactory dbf)
      Creates a new source that consists of the given source with all whitespace characters replaced by spaces and consecutive whitespace characters collapsed.
    • Method Summary

      • Methods inherited from class javax.xml.transform.dom.DOMSource

        getNode, getSystemId, isEmpty, setNode, setSystemId
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WhitespaceNormalizedSource

        public WhitespaceNormalizedSource​(javax.xml.transform.Source originalSource)
        Creates a new source that consists of the given source with all whitespace characters replaced by spaces and consecutive whitespace characters collapsed.
        Parameters:
        originalSource - the original source
      • WhitespaceNormalizedSource

        public WhitespaceNormalizedSource​(javax.xml.transform.Source originalSource,
                                          javax.xml.parsers.DocumentBuilderFactory dbf)
        Creates a new source that consists of the given source with all whitespace characters replaced by spaces and consecutive whitespace characters collapsed.
        Parameters:
        originalSource - the original source
        dbf - the DocumentBuilderFactory to use when creating a DOM document from originalSource