Class XMLDocumentBuilder

java.lang.Object
javax.xml.parsers.DocumentBuilder
io.sf.carte.doc.dom.XMLDocumentBuilder

public class XMLDocumentBuilder extends DocumentBuilder
Generic DocumentBuilder for XML documents.
  • Constructor Details

  • Method Details

    • parse

      public Document parse(InputSource is) throws SAXException, IOException
      Specified by:
      parse in class DocumentBuilder
      Throws:
      SAXException
      IOException
    • isNamespaceAware

      public boolean isNamespaceAware()
      Specified by:
      isNamespaceAware in class DocumentBuilder
    • isValidating

      public boolean isValidating()
      Specified by:
      isValidating in class DocumentBuilder
    • isXIncludeAware

      public boolean isXIncludeAware()
      Overrides:
      isXIncludeAware in class DocumentBuilder
    • setEntityResolver

      public void setEntityResolver(EntityResolver er)
      Specified by:
      setEntityResolver in class DocumentBuilder
    • setErrorHandler

      public void setErrorHandler(ErrorHandler eh)
      Specified by:
      setErrorHandler in class DocumentBuilder
    • newDocument

      public Document newDocument()
      Specified by:
      newDocument in class DocumentBuilder
    • getDOMImplementation

      public DOMImplementation getDOMImplementation()
      Specified by:
      getDOMImplementation in class DocumentBuilder
    • getSAXParserFactory

      public SAXParserFactory getSAXParserFactory()
      Get the SAXParserFactory object used by this builder.
      Returns:
      the SAXParserFactory object.
    • getSchema

      public Schema getSchema()
      Overrides:
      getSchema in class DocumentBuilder
    • setHTMLProcessing

      public void setHTMLProcessing(boolean html)
      Configure the builder to process the document as XHTML.

      Default is false.

      Parameters:
      html - set it to true to process the document as HTML.
    • setIgnoreElementContentWhitespace

      public void setIgnoreElementContentWhitespace(boolean ignore)
      Configure the builder to ignore (or not) element content whitespace when building the document.

      Default is false.

      Parameters:
      ignore - set it to true to ignore element content whitespace.
    • setIgnoreNotSpecifiedAttributes

      public void setIgnoreNotSpecifiedAttributes(boolean ignore)
      Configure the builder to ignore (or not) the attributes that were not specified, when building the document.

      Default is true.

      Parameters:
      ignore - set it to false to set attributes that have a default value but were not specified.
    • setStrictErrorChecking

      public void setStrictErrorChecking(boolean strictErrorChecking)
      Set the strictErrorChecking flag on the documents created by the DOM implementation.

      Default is true.

      Parameters:
      strictErrorChecking - the value of the strictErrorChecking flag.
    • setXMLReader

      public void setXMLReader(XMLReader xmlReader)
      Set the XMLReader to be used when parsing.

      If no XMLReader is set, one will be created by the SAXParserFactory.

      Parameters:
      xmlReader - the XMLReader.
    • reset

      public void reset()
      Overrides:
      reset in class DocumentBuilder