public class

DOMParserImpl

extends AbstractDOMParser
implements DOMConfiguration LSParser
java.lang.Object
   ↳ org.apache.xerces.parsers.XMLParser
     ↳ org.apache.xerces.parsers.AbstractXMLDocumentParser
       ↳ org.apache.xerces.parsers.AbstractDOMParser
         ↳ org.apache.xerces.parsers.DOMParserImpl
Known Direct Subclasses

Class Overview

This is Xerces DOM Builder class. It uses the abstract DOM parser with a document scanner, a dtd scanner, and a validator, as well as a grammar pool.

Summary

Constants
boolean DEBUG
String DISALLOW_DOCTYPE_DECL_FEATURE Feature identifier: disallow docType Decls.
String DYNAMIC_VALIDATION Dynamic validation
String HONOUR_ALL_SCHEMALOCATIONS Feature identifier: honour all schemaLocations
String NAMESPACES Feature identifier: namespaces.
String NORMALIZE_DATA Feature identifier: expose schema normalized value
String PSVI_AUGMENT
String SYMBOL_TABLE
String VALIDATION_FEATURE Feature id: validation.
String XMLSCHEMA XML Schema validation
String XMLSCHEMA_FULL_CHECKING XML Schema full checking
[Expand]
Inherited Constants
From class org.apache.xerces.parsers.AbstractDOMParser
From class org.apache.xerces.parsers.XMLParser
From interface org.apache.xerces.xni.XMLDTDContentModelHandler
From interface org.apache.xerces.xni.XMLDTDHandler
From interface org.w3c.dom.ls.LSParser
Fields
protected boolean fBusy
protected boolean fNamespaceDeclarations Include namespace declaration attributes in the document.
protected String fSchemaType
[Expand]
Inherited Fields
From class org.apache.xerces.parsers.AbstractDOMParser
From class org.apache.xerces.parsers.AbstractXMLDocumentParser
From class org.apache.xerces.parsers.XMLParser
Public Constructors
DOMParserImpl(String configuration, String schemaType)
Constructs a DOM Builder using the standard parser configuration.
DOMParserImpl(XMLParserConfiguration config)
Constructs a DOM Builder using the specified parser configuration.
DOMParserImpl(SymbolTable symbolTable)
Constructs a DOM Builder using the specified symbol table.
DOMParserImpl(SymbolTable symbolTable, XMLGrammarPool grammarPool)
Constructs a DOM Builder using the specified symbol table and grammar pool.
Public Methods
void abort()
boolean canSetParameter(String name, Object value)
boolean getAsync()
boolean getBusy()
DOMConfiguration getDomConfig()
LSParserFilter getFilter()
When the application provides a filter, the parser will call out to the filter at the completion of the construction of each Element node.
Object getParameter(String name)
Look up the value of a feature or a property.
DOMStringList getParameterNames()
DOM Level 3 CR - Experimental.
Document parse(LSInput is)
Parse an XML document from a resource identified by an LSInput.
Document parseURI(String uri)
Parse an XML document from a location identified by an URI reference.
Node parseWithContext(LSInput is, Node cnode, short action)
Parse an XML document or fragment from a resource identified by an LSInput and insert the content into an existing document at the position epcified with the contextNode and action arguments.
void reset()
Resets the parser state.
void setFilter(LSParserFilter filter)
When the application provides a filter, the parser will call out to the filter at the completion of the construction of each Element node.
void setParameter(String name, Object value)
Set parameters and properties
void startElement(QName element, XMLAttributes attributes, Augmentations augs)
The start of an element.
[Expand]
Inherited Methods
From class org.apache.xerces.parsers.AbstractDOMParser
From class org.apache.xerces.parsers.AbstractXMLDocumentParser
From class org.apache.xerces.parsers.XMLParser
From class java.lang.Object
From interface org.apache.xerces.xni.XMLDTDContentModelHandler
From interface org.apache.xerces.xni.XMLDTDHandler
From interface org.apache.xerces.xni.XMLDocumentHandler
From interface org.w3c.dom.DOMConfiguration
From interface org.w3c.dom.ls.LSParser

Constants

protected static final boolean DEBUG

Constant Value: false

protected static final String DISALLOW_DOCTYPE_DECL_FEATURE

Feature identifier: disallow docType Decls.

Constant Value: "http://apache.org/xml/features/disallow-doctype-decl"

protected static final String DYNAMIC_VALIDATION

Dynamic validation

Constant Value: "http://apache.org/xml/features/validation/dynamic"

protected static final String HONOUR_ALL_SCHEMALOCATIONS

Feature identifier: honour all schemaLocations

Constant Value: "http://apache.org/xml/features/honour-all-schemaLocations"

protected static final String NAMESPACES

Feature identifier: namespaces.

Constant Value: "http://xml.org/sax/features/namespaces"

protected static final String NORMALIZE_DATA

Feature identifier: expose schema normalized value

Constant Value: "http://apache.org/xml/features/validation/schema/normalized-value"

protected static final String PSVI_AUGMENT

Constant Value: "http://apache.org/xml/features/validation/schema/augment-psvi"

protected static final String SYMBOL_TABLE

Constant Value: "http://apache.org/xml/properties/internal/symbol-table"

protected static final String VALIDATION_FEATURE

Feature id: validation.

Constant Value: "http://xml.org/sax/features/validation"

protected static final String XMLSCHEMA

XML Schema validation

Constant Value: "http://apache.org/xml/features/validation/schema"

protected static final String XMLSCHEMA_FULL_CHECKING

XML Schema full checking

Constant Value: "http://apache.org/xml/features/validation/schema-full-checking"

Fields

protected boolean fBusy

protected boolean fNamespaceDeclarations

Include namespace declaration attributes in the document.

protected String fSchemaType

Public Constructors

public DOMParserImpl (String configuration, String schemaType)

Constructs a DOM Builder using the standard parser configuration.

public DOMParserImpl (XMLParserConfiguration config)

Constructs a DOM Builder using the specified parser configuration.

public DOMParserImpl (SymbolTable symbolTable)

Constructs a DOM Builder using the specified symbol table.

public DOMParserImpl (SymbolTable symbolTable, XMLGrammarPool grammarPool)

Constructs a DOM Builder using the specified symbol table and grammar pool.

Public Methods

public void abort ()

See Also

public boolean canSetParameter (String name, Object value)

public boolean getAsync ()

See Also

public boolean getBusy ()

See Also

public DOMConfiguration getDomConfig ()

public LSParserFilter getFilter ()

When the application provides a filter, the parser will call out to the filter at the completion of the construction of each Element node. The filter implementation can choose to remove the element from the document being constructed (unless the element is the document element) or to terminate the parse early. If the document is being validated when it's loaded the validation happens before the filter is called.

public Object getParameter (String name)

Look up the value of a feature or a property.

Throws
DOMException

public DOMStringList getParameterNames ()

DOM Level 3 CR - Experimental. The list of the parameters supported by this DOMConfiguration object and for which at least one value can be set by the application. Note that this list can also contain parameter names defined outside this specification.

public Document parse (LSInput is)

Parse an XML document from a resource identified by an LSInput.

Throws
LSException

public Document parseURI (String uri)

Parse an XML document from a location identified by an URI reference. If the URI contains a fragment identifier (see section 4.1 in ), the behavior is not defined by this specification.

Throws
LSException

public Node parseWithContext (LSInput is, Node cnode, short action)

Parse an XML document or fragment from a resource identified by an LSInput and insert the content into an existing document at the position epcified with the contextNode and action arguments. When parsing the input stream the context node is used for resolving unbound namespace prefixes.

Parameters
is The LSInput from which the source document is to be read.
cnode The Node that is used as the context for the data that is being parsed.
action This parameter describes which action should be taken between the new set of node being inserted and the existing children of the context node. The set of possible actions is defined above.
Throws
DOMException HIERARCHY_REQUEST_ERR: Thrown if this action results in an invalid hierarchy (i.e. a Document with more than one document element).
LSException

public void reset ()

Resets the parser state.

Throws
SAXException Thrown on initialization error.

public void setFilter (LSParserFilter filter)

When the application provides a filter, the parser will call out to the filter at the completion of the construction of each Element node. The filter implementation can choose to remove the element from the document being constructed (unless the element is the document element) or to terminate the parse early. If the document is being validated when it's loaded the validation happens before the filter is called.

public void setParameter (String name, Object value)

Set parameters and properties

Throws
DOMException

public void startElement (QName element, XMLAttributes attributes, Augmentations augs)

The start of an element. If the document specifies the start element by using an empty tag, then the startElement method will immediately be followed by the endElement method, with no intervening methods. Overriding the parent to handle DOM_NAMESPACE_DECLARATIONS=false.

Parameters
element The name of the element.
attributes The element attributes.
augs Additional information that may include infoset augmentations
Throws
XNIException Thrown by handler to signal an error.