Class NormalizedSource

  • All Implemented Interfaces:
    Source

    public class NormalizedSource
    extends DOMSource
    Performs XML normalization on a given Source, Document or Node.

    For Nodes this means adjacent text nodes are merged to single nodes and empty Text nodes removed (recursively). For Documents and Sources additional normalization steps may be taken depending on your DOMConfiguration. See the linked JavaDocs for details.

    When reading documents a parser usually puts the document into normalized form anway. You will only need to perform XML normalization on DOM trees you have created programmatically.

    See Also:
    "http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/Document.html#normalizeDocument%28%29", "http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/Node.html#normalize%28%29"
    • Constructor Detail

      • NormalizedSource

        public NormalizedSource()
        An empty source.
      • NormalizedSource

        public NormalizedSource​(Source originalSource)
        Creates a new source that is created by "normalizing" the given source.

        See the class-level JavaDocs for details.

        Parameters:
        originalSource - the original source
      • NormalizedSource

        public NormalizedSource​(Document doc)
        Creates a new source that is created by "normalizing" the given document.

        See the class-level JavaDocs for details.

        Parameters:
        doc - the original source
      • NormalizedSource

        public NormalizedSource​(Document doc,
                                String systemId)
        Creates a new source that is created by "normalizing" the given document.

        See the class-level JavaDocs for details.

        Parameters:
        doc - the original source
        systemId - the system id to use for the new source
      • NormalizedSource

        public NormalizedSource​(Node n)
        Creates a new source that is created by "normalizing" the given node.

        See the class-level JavaDocs for details.

        Parameters:
        n - the original node
      • NormalizedSource

        public NormalizedSource​(Node n,
                                String systemId)
        Creates a new source that is created by "normalizing" the given node.

        See the class-level JavaDocs for details.

        Parameters:
        n - the original node
        systemId - the system id to use for the new source