Save This Page
Home » Xerces-J-src.2.9.1 » org.apache.xerces » impl » [javadoc | source]
org.apache.xerces.impl
public class: XMLNSDocumentScannerImpl [javadoc | source]
java.lang.Object
   org.apache.xerces.impl.XMLScanner
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
         org.apache.xerces.impl.XMLDocumentScannerImpl
            org.apache.xerces.impl.XMLNSDocumentScannerImpl

All Implemented Interfaces:
    XMLComponent, XMLEntityHandler, XMLDocumentScanner

The scanner acts as the source for the document information which is communicated to the document handler. This class scans an XML document, checks if document has a DTD, and if DTD is not found the scanner will remove the DTD Validator from the pipeline and perform namespace binding. Note: This scanner should only be used when the namespace processing is on!

This component requires the following features and properties from the component manager that uses it:

Nested Class Summary:
protected final class  XMLNSDocumentScannerImpl.NSContentDispatcher  Dispatcher to handle content scanning. 
Field Summary
protected  boolean fBindNamespaces    If is true, the dtd validator is no longer in the pipeline and the scanner should bind namespaces 
protected  boolean fPerformValidation    If validating parser, make sure we report an error in the scanner if DTD grammar is missing. 
Fields inherited from org.apache.xerces.impl.XMLDocumentScannerImpl:
SCANNER_STATE_XML_DECL,  SCANNER_STATE_PROLOG,  SCANNER_STATE_TRAILING_MISC,  SCANNER_STATE_DTD_INTERNAL_DECLS,  SCANNER_STATE_DTD_EXTERNAL,  SCANNER_STATE_DTD_EXTERNAL_DECLS,  LOAD_EXTERNAL_DTD,  DISALLOW_DOCTYPE_DECL_FEATURE,  DTD_SCANNER,  VALIDATION_MANAGER,  NAMESPACE_CONTEXT,  fDTDScanner,  fValidationManager,  fScanningDTD,  fDoctypeName,  fDoctypePublicId,  fDoctypeSystemId,  fNamespaceContext,  fLoadExternalDTD,  fDisallowDoctype,  fSeenDoctypeDecl,  fXMLDeclDispatcher,  fPrologDispatcher,  fDTDDispatcher,  fTrailingMiscDispatcher
Fields inherited from org.apache.xerces.impl.XMLDocumentFragmentScannerImpl:
SCANNER_STATE_START_OF_MARKUP,  SCANNER_STATE_COMMENT,  SCANNER_STATE_PI,  SCANNER_STATE_DOCTYPE,  SCANNER_STATE_ROOT_ELEMENT,  SCANNER_STATE_CONTENT,  SCANNER_STATE_REFERENCE,  SCANNER_STATE_END_OF_INPUT,  SCANNER_STATE_TERMINATED,  SCANNER_STATE_CDATA,  SCANNER_STATE_TEXT_DECL,  NAMESPACES,  NOTIFY_BUILTIN_REFS,  ENTITY_RESOLVER,  DEBUG_CONTENT_SCANNING,  fDocumentHandler,  fEntityStack,  fMarkupDepth,  fScannerState,  fInScanContent,  fHasExternalDTD,  fStandalone,  fIsEntityDeclaredVC,  fExternalSubsetResolver,  fCurrentElement,  fElementStack,  fNotifyBuiltInRefs,  fDispatcher,  fContentDispatcher,  fElementQName,  fAttributeQName,  fAttributes,  fTempString,  fTempString2
Fields inherited from org.apache.xerces.impl.XMLScanner:
VALIDATION,  NAMESPACES,  NOTIFY_CHAR_REFS,  PARSER_SETTINGS,  SYMBOL_TABLE,  ERROR_REPORTER,  ENTITY_MANAGER,  DEBUG_ATTR_NORMALIZATION,  fValidation,  fNamespaces,  fNotifyCharRefs,  fParserSettings,  fSymbolTable,  fErrorReporter,  fEntityManager,  fEntityScanner,  fEntityDepth,  fCharRefLiteral,  fScanningAttribute,  fReportEntity,  fVersionSymbol,  fEncodingSymbol,  fStandaloneSymbol,  fAmpSymbol,  fLtSymbol,  fGtSymbol,  fQuotSymbol,  fAposSymbol,  fResourceIdentifier
Method from org.apache.xerces.impl.XMLNSDocumentScannerImpl Summary:
createContentDispatcher,   reset,   scanAttribute,   scanEndElement,   scanStartElement,   scanStartElementAfterName,   scanStartElementName,   setDTDValidator
Methods from org.apache.xerces.impl.XMLDocumentScannerImpl:
createContentDispatcher,   endEntity,   getFeatureDefault,   getPropertyDefault,   getRecognizedFeatures,   getRecognizedProperties,   getScannerStateName,   reset,   scanDoctypeDecl,   setFeature,   setInputSource,   setProperty,   startEntity
Methods from org.apache.xerces.impl.XMLDocumentFragmentScannerImpl:
createContentDispatcher,   endEntity,   getDispatcherName,   getDocumentHandler,   getFeatureDefault,   getPropertyDefault,   getRecognizedFeatures,   getRecognizedProperties,   getScannerStateName,   handleEndElement,   reset,   scanAttribute,   scanCDATASection,   scanCharReference,   scanComment,   scanContent,   scanDocument,   scanEndElement,   scanEntityReference,   scanPIData,   scanStartElement,   scanStartElementAfterName,   scanStartElementName,   scanXMLDeclOrTextDecl,   setDispatcher,   setDocumentHandler,   setFeature,   setInputSource,   setProperty,   setScannerState,   startEntity
Methods from org.apache.xerces.impl.XMLScanner:
endEntity,   getFeature,   getVersionNotSupportedKey,   isInvalid,   isInvalidLiteral,   isUnchangedByNormalization,   isValidNCName,   isValidNameChar,   isValidNameStartChar,   isValidNameStartHighSurrogate,   normalizeWhitespace,   normalizeWhitespace,   reportFatalError,   reset,   reset,   scanAttributeValue,   scanCharReferenceValue,   scanComment,   scanExternalID,   scanPI,   scanPIData,   scanPseudoAttribute,   scanPubidLiteral,   scanSurrogates,   scanXMLDeclOrTextDecl,   setFeature,   setProperty,   startEntity,   versionSupported
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.xerces.impl.XMLNSDocumentScannerImpl Detail:
 protected Dispatcher createContentDispatcher() 
    Creates a content dispatcher.
 public  void reset(XMLComponentManager componentManager) throws XMLConfigurationException 
 protected  void scanAttribute(XMLAttributesImpl attributes) throws IOException, XNIException 
    Scans an attribute.

    [41] Attribute ::= Name Eq AttValue
    

    Note: This method assumes that the next character on the stream is the first character of the attribute name.

    Note: This method uses the fAttributeQName and fQName variables. The contents of these variables will be destroyed.

 protected int scanEndElement() throws IOException, XNIException 
    Scans an end element.

    [42] ETag ::= '</' Name S? '>'
    

    Note: This method uses the fElementQName variable. The contents of this variable will be destroyed. The caller should copy the needed information out of this variable before calling this method.

 protected boolean scanStartElement() throws IOException, XNIException 
    Scans a start element. This method will handle the binding of namespace information and notifying the handler of the start of the element.

    [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
    [40] STag ::= '<' Name (S Attribute)* S? '>'
    

    Note: This method assumes that the leading '<' character has been consumed.

    Note: This method uses the fElementQName and fAttributes variables. The contents of these variables will be destroyed. The caller should copy important information out of these variables before calling this method.

 protected boolean scanStartElementAfterName() throws IOException, XNIException 
    Scans the remainder of a start or empty tag after the element name.
 protected  void scanStartElementName() throws IOException, XNIException 
    Scans the name of an element in a start or empty tag.
 public  void setDTDValidator(XMLDTDValidatorFilter dtdValidator) 
    The scanner is responsible for removing DTD validator from the pipeline if it is not needed.