org.enhydra.xml.xmlc.parsers.xerces
Class XercesDOMParser

java.lang.Object
  |
  +--org.enhydra.apache.xerces.parsers.XMLParser
        |
        +--org.enhydra.apache.xerces.parsers.AbstractXMLDocumentParser
              |
              +--org.enhydra.apache.xerces.parsers.AbstractDOMParser
                    |
                    +--org.enhydra.apache.xerces.parsers.DOMParser
                          |
                          +--org.enhydra.xml.xmlc.parsers.xerces.XercesDOMParser
All Implemented Interfaces:
XMLCParser, org.enhydra.apache.xerces.xni.XMLDocumentHandler, org.enhydra.apache.xerces.xni.XMLDTDContentModelHandler, org.enhydra.apache.xerces.xni.XMLDTDHandler, org.enhydra.apache.xerces.xni.parser.XMLEntityResolver
Direct Known Subclasses:
XercesHTMLDOMParser

public class XercesDOMParser
extends org.enhydra.apache.xerces.parsers.DOMParser
implements XMLCParser, org.enhydra.apache.xerces.xni.parser.XMLEntityResolver


Fields inherited from class org.enhydra.apache.xerces.parsers.DOMParser
fUseEntityResolver2, SYMBOL_TABLE, USE_ENTITY_RESOLVER2, XMLGRAMMAR_POOL
 
Fields inherited from class org.enhydra.apache.xerces.parsers.AbstractDOMParser
abort, CORE_DOCUMENT_CLASS_NAME, CREATE_CDATA_NODES_FEATURE, CREATE_ENTITY_REF_NODES, CURRENT_ELEMENT_NODE, DEFAULT_DOCUMENT_CLASS_NAME, DEFER_NODE_EXPANSION, DOCUMENT_CLASS_NAME, fBaseURIStack, fCreateCDATANodes, fCreateEntityRefNodes, fCurrentCDATASection, fCurrentCDATASectionIndex, fCurrentEntityDecl, fCurrentNode, fCurrentNodeIndex, fDeferNodeExpansion, fDeferredDocumentImpl, fDeferredEntityDecl, fDocument, fDocumentClassName, fDocumentImpl, fDocumentIndex, fDocumentType, fDocumentTypeIndex, fDOMFilter, fErrorHandler, fFilterReject, fFirstChunk, fInCDATASection, fIncludeComments, fIncludeIgnorableWhitespace, fInDTD, fInDTDExternalSubset, fInEntityRef, fInternalSubset, fNamespaceAware, fRejectedElement, fRoot, fSkippedElemStack, fStorePSVI, fStringBuffer, INCLUDE_COMMENTS_FEATURE, INCLUDE_IGNORABLE_WHITESPACE, NAMESPACES, PSVI_DOCUMENT_CLASS_NAME
 
Fields inherited from class org.enhydra.apache.xerces.parsers.AbstractXMLDocumentParser
fDocumentSource, fDTDContentModelSource, fDTDSource
 
Fields inherited from class org.enhydra.apache.xerces.parsers.XMLParser
ENTITY_RESOLVER, ERROR_HANDLER, fConfiguration
 
Fields inherited from interface org.enhydra.apache.xerces.xni.XMLDTDHandler
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE
 
Fields inherited from interface org.enhydra.apache.xerces.xni.XMLDTDContentModelHandler
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE
 
Constructor Summary
XercesDOMParser()
           
XercesDOMParser(org.enhydra.apache.xerces.xni.parser.XMLParserConfiguration config)
           
 
Method Summary
 void attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, org.enhydra.apache.xerces.xni.XMLString defaultValue, org.enhydra.apache.xerces.xni.XMLString nonNormalizedDefaultValue, org.enhydra.apache.xerces.xni.Augmentations augs)
          Checks if the type of the current attribute is of type "ID".
 void elementDecl(String name, String contentModel, org.enhydra.apache.xerces.xni.Augmentations augs)
          The pcData(Augmentations) method sets a flag saying whether the current element can contain PCDATA.
protected  void features(MetaData metaData)
          Called by parse() to allow DOMParser features to be set.
 XMLCDocument parse(InputSource input, LineNumberMap lineNumberMap, XMLCDomFactory domFactory, MetaData metaData, ErrorReporter errorReporter, ParseTracer tracer)
          Parses using the Xerces DOMParser and the XMLC XMLEntityResolver.
 void pcdata(org.enhydra.apache.xerces.xni.Augmentations augs)
          Sets a flag saying that the current element can contain PCDATA.
 org.enhydra.apache.xerces.xni.parser.XMLInputSource resolveEntity(org.enhydra.apache.xerces.xni.XMLResourceIdentifier resourceIdentifier)
          Uses XMLC's own catalog resolver.
 void xmlDecl(String version, String encoding, String standalone, org.enhydra.apache.xerces.xni.Augmentations augs)
          Sets the version and encoding values to the xmlcDocument.
 
Methods inherited from class org.enhydra.apache.xerces.parsers.DOMParser
, getEntityResolver, getErrorHandler, getFeature, getProperty, getXMLParserConfiguration, parse, parse, setEntityResolver, setErrorHandler, setFeature, setProperty
 
Methods inherited from class org.enhydra.apache.xerces.parsers.AbstractDOMParser
abort, characters, comment, createAttrNode, createElementNode, doctypeDecl, dropDocumentReferences, emptyElement, endAttlist, endCDATA, endConditional, endDocument, endDTD, endElement, endExternalSubset, endGeneralEntity, endParameterEntity, externalEntityDecl, getDocument, getDocumentClassName, handleBaseURI, handleBaseURI, ignorableWhitespace, ignoredCharacters, internalEntityDecl, notationDecl, processingInstruction, reset, setCharacterData, setDocumentClassName, setLocale, startAttlist, startCDATA, startConditional, startDocument, startDTD, startElement, startExternalSubset, startGeneralEntity, startParameterEntity, textDecl, unparsedEntityDecl
 
Methods inherited from class org.enhydra.apache.xerces.parsers.AbstractXMLDocumentParser
any, element, empty, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, occurrence, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startContentModel, startGroup
 
Methods inherited from class org.enhydra.apache.xerces.parsers.XMLParser
parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XercesDOMParser

public XercesDOMParser()

XercesDOMParser

public XercesDOMParser(org.enhydra.apache.xerces.xni.parser.XMLParserConfiguration config)
Method Detail

parse

public XMLCDocument parse(InputSource input,
                          LineNumberMap lineNumberMap,
                          XMLCDomFactory domFactory,
                          MetaData metaData,
                          ErrorReporter errorReporter,
                          ParseTracer tracer)
                   throws IOException,
                          XMLCException,
                          SAXException
Parses using the Xerces DOMParser and the XMLC XMLEntityResolver. The resulting DOM document is set on the XMLCDocument after a successful parse. The type of DOM bound to by the DOM parser is defined by setting the Xerces property "http://apache.org/xml/properties/dom/document-class-name" to the fully qualified DOM Document name returned by the getDocumentClassName() method of the current XMLCDomFactory.
Specified by:
parse in interface XMLCParser
Returns:
a populated XMLCDocument
See Also:
XMLCParser.parse(org.xml.sax.InputSource, org.enhydra.xml.xmlc.misc.LineNumberMap, org.enhydra.xml.xmlc.dom.XMLCDomFactory, org.enhydra.xml.xmlc.metadata.MetaData, org.enhydra.xml.io.ErrorReporter, org.enhydra.xml.xmlc.parsers.ParseTracer)

features

protected void features(MetaData metaData)
                 throws XMLCException
Called by parse() to allow DOMParser features to be set. Also provides an opportunity to validate metadata, if need be.
Parameters:
metaData - the XMLC metadata for the markup to be parsed
Throws:
XMLCException - if metadata is found to be invalid for the current parser

xmlDecl

public void xmlDecl(String version,
                    String encoding,
                    String standalone,
                    org.enhydra.apache.xerces.xni.Augmentations augs)
             throws org.enhydra.apache.xerces.xni.XNIException
Sets the version and encoding values to the xmlcDocument. Execution is then passed to the superclass.
Overrides:
xmlDecl in class org.enhydra.apache.xerces.parsers.AbstractDOMParser
See Also:
XMLDocumentHandler.xmlDecl(String, String, String, org.enhydra.apache.xerces.xni.Augmentations)

attributeDecl

public void attributeDecl(String elementName,
                          String attributeName,
                          String type,
                          String[] enumeration,
                          String defaultType,
                          org.enhydra.apache.xerces.xni.XMLString defaultValue,
                          org.enhydra.apache.xerces.xni.XMLString nonNormalizedDefaultValue,
                          org.enhydra.apache.xerces.xni.Augmentations augs)
                   throws org.enhydra.apache.xerces.xni.XNIException
Checks if the type of the current attribute is of type "ID". If so, the attribute is recorded as such (along with the element it belongs to) in the xmlcDocument. Execution is then passed to the superclass.
Overrides:
attributeDecl in class org.enhydra.apache.xerces.parsers.AbstractDOMParser
See Also:
XMLDTDHandler.attributeDecl(String, String, String, String[], String, org.enhydra.apache.xerces.xni.XMLString, org.enhydra.apache.xerces.xni.XMLString, org.enhydra.apache.xerces.xni.Augmentations)

elementDecl

public void elementDecl(String name,
                        String contentModel,
                        org.enhydra.apache.xerces.xni.Augmentations augs)
                 throws org.enhydra.apache.xerces.xni.XNIException
The pcData(Augmentations) method sets a flag saying whether the current element can contain PCDATA. This method, which is called shortly after pcdata() method is called, checks that flag and, if true, stores the element as a PCDATA element in the xmlcDocument, and resets the flag. Execution is then passed to the superclass.
Overrides:
elementDecl in class org.enhydra.apache.xerces.parsers.AbstractDOMParser
See Also:
XMLDTDHandler.elementDecl(String, String, org.enhydra.apache.xerces.xni.Augmentations), pcdata(Augmentations)

pcdata

public void pcdata(org.enhydra.apache.xerces.xni.Augmentations augs)
            throws org.enhydra.apache.xerces.xni.XNIException
Sets a flag saying that the current element can contain PCDATA. Execution is then passed to the superclass.
Overrides:
pcdata in class org.enhydra.apache.xerces.parsers.AbstractXMLDocumentParser
See Also:
XMLDTDContentModelHandler.pcdata(org.enhydra.apache.xerces.xni.Augmentations)

resolveEntity

public org.enhydra.apache.xerces.xni.parser.XMLInputSource resolveEntity(org.enhydra.apache.xerces.xni.XMLResourceIdentifier resourceIdentifier)
                                                                  throws org.enhydra.apache.xerces.xni.XNIException,
                                                                         IOException
Uses XMLC's own catalog resolver. Execution is NOT passed to the superclass.
Specified by:
resolveEntity in interface org.enhydra.apache.xerces.xni.parser.XMLEntityResolver
See Also:
XMLEntityResolver, XMLEntityResolver.resolveEntity(org.enhydra.apache.xerces.xni.XMLResourceIdentifier)


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.