Class NamespaceEmitter

All Implemented Interfaces:
Result

public class NamespaceEmitter extends ProxyEmitter
NamespaceEmitter is a ProxyEmitter responsible for removing duplicate namespace declarations. It also ensures that an xmlns="" undeclaration is output when necessary.
  • Field Details

    • namePool

      protected NamePool namePool
    • nscodeXML

      protected int nscodeXML
    • nscodeNull

      protected int nscodeNull
  • Constructor Details

    • NamespaceEmitter

      public NamespaceEmitter()
  • Method Details

    • setNamePool

      public void setNamePool(NamePool pool)
      Set the name pool to be used for all name codes
      Overrides:
      setNamePool in class ProxyEmitter
    • startElement

      public void startElement(int nameCode, Attributes attList, int[] namespaceCodes, int nrOfCodes) throws TransformerException
      startElement. This call removes redundant namespace declarations, and possibly adds an xmlns="" undeclaration.
      Overrides:
      startElement in class ProxyEmitter
      Parameters:
      namespaceCodes - Array of namespace codes identifying the namespace prefix/uri pairs associated with this element
      nrOfCodes - Number of significant entries within namespaces array
      Throws:
      TransformerException
    • endElement

      public void endElement(int nameCode) throws TransformerException
      endElement: Discard the namespaces declared on this element.
      Overrides:
      endElement in class ProxyEmitter
      Throws:
      TransformerException