Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xerces.impl
Class XMLNSDocumentScannerImpl

    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:
  org.apache.xerces.xni.parser.XMLComponent, org.apache.xerces.xni.parser.XMLDocumentScanner, org.apache.xerces.xni.parser.XMLDocumentSource, XMLEntityHandler

public class XMLNSDocumentScannerImpl
extends XMLDocumentScannerImpl

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:

- http://xml.org/sax/features/namespaces {true} -- if the value of this feature is set to false this scanner must not be used.
- http://xml.org/sax/features/validation
- http://apache.org/xml/features/nonvalidating/load-external-dtd
- http://apache.org/xml/features/scanner/notify-char-refs
- http://apache.org/xml/features/scanner/notify-builtin-refs
- http://apache.org/xml/properties/internal/symbol-table
- http://apache.org/xml/properties/internal/error-reporter
- http://apache.org/xml/properties/internal/entity-manager
- http://apache.org/xml/properties/internal/dtd-scanner

Version:
  $Id: XMLNSDocumentScannerImpl.java,v 1.11 2002/12/28 02:23:12 elena Exp $
Author:
  Elena Litani, IBM

Inner Class Summary
`protected class` | `XMLNSDocumentScannerImpl.NSContentDispatcher` Dispatcher to handle content scanning.

Inner classes inherited from class org.apache.xerces.impl.XMLDocumentScannerImpl
`XMLDocumentScannerImpl.ContentDispatcher, XMLDocumentScannerImpl.DTDDispatcher, XMLDocumentScannerImpl.PrologDispatcher, XMLDocumentScannerImpl.TrailingMiscDispatcher, XMLDocumentScannerImpl.XMLDeclDispatcher`

Inner classes inherited from class org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
`XMLDocumentFragmentScannerImpl.Dispatcher, XMLDocumentFragmentScannerImpl.ElementStack, XMLDocumentFragmentScannerImpl.FragmentContentDispatcher`

Field Summary
`protected boolean` | `fBindNamespaces` If is true, the dtd validator is no longer in the pipeline and the scanner should bind namespaces
`protected int` | `fLength`
`protected java.lang.String[]` | `fLocalpart`
`protected boolean` | `fPerformValidation` If validating parser, make sure we report an error in the scanner if DTD grammar is missing.
`protected java.lang.String[]` | `fUri`

Fields inherited from class org.apache.xerces.impl.XMLDocumentScannerImpl
`DISALLOW_DOCTYPE_DECL_FEATURE, DTD_SCANNER, fDisallowDoctype, fDoctypeName, fDoctypePublicId, fDoctypeSystemId, fDTDDispatcher, fDTDScanner, fLoadExternalDTD, fNamespaceContext, fPrologDispatcher, fScanningDTD, fSeenDoctypeDecl, fTrailingMiscDispatcher, fValidationManager, fXMLDeclDispatcher, LOAD_EXTERNAL_DTD, SCANNER_STATE_DTD_EXTERNAL, SCANNER_STATE_DTD_EXTERNAL_DECLS, SCANNER_STATE_DTD_INTERNAL_DECLS, SCANNER_STATE_PROLOG, SCANNER_STATE_TRAILING_MISC, SCANNER_STATE_XML_DECL, VALIDATION_MANAGER`

Fields inherited from class org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
`DEBUG_CONTENT_SCANNING, fAttributeQName, fAttributes, fContentDispatcher, fCurrentElement, fDispatcher, fDocumentHandler, fElementQName, fElementStack, fEntityStack, fHasExternalDTD, fInScanContent, fMarkupDepth, fNamespaces, fNotifyBuiltInRefs, fScannerState, fStandalone, fTempString, fTempString2, NAMESPACES, NOTIFY_BUILTIN_REFS, SCANNER_STATE_CDATA, SCANNER_STATE_COMMENT, SCANNER_STATE_CONTENT, SCANNER_STATE_DOCTYPE, SCANNER_STATE_END_OF_INPUT, SCANNER_STATE_PI, SCANNER_STATE_REFERENCE, SCANNER_STATE_ROOT_ELEMENT, SCANNER_STATE_START_OF_MARKUP, SCANNER_STATE_TERMINATED, SCANNER_STATE_TEXT_DECL`

Fields inherited from class org.apache.xerces.impl.XMLScanner
`DEBUG_ATTR_NORMALIZATION, ENTITY_MANAGER, ERROR_REPORTER, fAmpSymbol, fAposSymbol, fCharRefLiteral, fEncodingSymbol, fEntityDepth, fEntityManager, fEntityScanner, fErrorReporter, fGtSymbol, fLtSymbol, fNotifyCharRefs, fQuotSymbol, fReportEntity, fResourceIdentifier, fScanningAttribute, fStandaloneSymbol, fSymbolTable, fValidation, fVersionSymbol, NOTIFY_CHAR_REFS, SYMBOL_TABLE, VALIDATION`

Constructor Summary
`XMLNSDocumentScannerImpl()`

Method Summary
`protected XMLDocumentFragmentScannerImpl.Dispatcher` | `createContentDispatcher()` Creates a content dispatcher.
`void` | `reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)` Resets the component.
`protected void` | `scanAttribute(XMLAttributesImpl attributes)` Scans an attribute.
`protected int` | `scanEndElement()` Scans an end element.
`protected boolean` | `scanStartElement()` Scans a start element.
`void` | `setDTDValidator(XMLDTDValidatorFilter dtd)` The scanner is responsible for removing DTD validator from the pipeline if it is not needed.

Methods inherited from class org.apache.xerces.impl.XMLDocumentScannerImpl
`endEntity, getFeatureDefault, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, getScannerStateName, scanDoctypeDecl, setFeature, setInputSource, setProperty, startEntity`

Methods inherited from class org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
`getDispatcherName, getDocumentHandler, handleEndElement, scanAttribute, scanCDATASection, scanCharReference, scanComment, scanContent, scanDocument, scanEntityReference, scanPIData, scanXMLDeclOrTextDecl, setDispatcher, setDocumentHandler, setScannerState`

Methods inherited from class org.apache.xerces.impl.XMLScanner
`getFeature, isInvalid, isInvalidLiteral, isValidNameChar, isValidNameStartChar, normalizeWhitespace, reportFatalError, reset, scanAttributeValue, scanCharReferenceValue, scanComment, scanExternalID, scanPI, scanPseudoAttribute, scanPubidLiteral, scanSurrogates, scanXMLDeclOrTextDecl, versionSupported`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### fBindNamespaces

    protected boolean fBindNamespaces

  If is true, the dtd validator is no longer in the pipeline and the scanner should bind namespaces

### fPerformValidation

    protected boolean fPerformValidation

  If validating parser, make sure we report an error in the scanner if DTD grammar is missing.

### fUri

    protected java.lang.String[] fUri

### fLocalpart

    protected java.lang.String[] fLocalpart

### fLength

    protected int fLength

Constructor Detail

### XMLNSDocumentScannerImpl

    public XMLNSDocumentScannerImpl()

Method Detail

### setDTDValidator

    public void setDTDValidator(XMLDTDValidatorFilter dtd)

  The scanner is responsible for removing DTD validator from the pipeline if it is not needed.
  Parameters:
    `previous` - The filter component before DTDValidator
    `dtdValidator` - The DTDValidator
    `next` - The documentHandler after the DTDValidator

### scanStartElement

    protected boolean scanStartElement()
                                throws java.io.IOException,
                                       org.apache.xerces.xni.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.

  Overrides:
    `scanStartElement` in class `XMLDocumentFragmentScannerImpl`
  Returns:
    True if element is empty. (i.e. It matches production [44].

### scanAttribute

    protected void scanAttribute(XMLAttributesImpl attributes)
                          throws java.io.IOException,
                                 org.apache.xerces.xni.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.

  Parameters:
    `attributes` - The attributes list for the scanned attribute.

### scanEndElement

    protected int scanEndElement()
                          throws java.io.IOException,
                                 org.apache.xerces.xni.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.

  Overrides:
    `scanEndElement` in class `XMLDocumentFragmentScannerImpl`
  Returns:
    The element depth.

### reset

    public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
               throws org.apache.xerces.xni.parser.XMLConfigurationException

  Description copied from class: `XMLDocumentScannerImpl`
  Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.
  Overrides:
    `reset` in class `XMLDocumentScannerImpl`
  Following copied from class: `org.apache.xerces.impl.XMLDocumentScannerImpl`
  Parameters:
    `componentManager` - The component manager.
  Throws:
    `SAXException` - Thrown by component on initialization error. For example, if a feature or property is required for the operation of the component, the component manager may throw a SAXNotRecognizedException or a SAXNotSupportedException.

### createContentDispatcher

    protected XMLDocumentFragmentScannerImpl.Dispatcher createContentDispatcher()

  Creates a content dispatcher.
  Overrides:
    `createContentDispatcher` in class `XMLDocumentScannerImpl`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2003 Apache XML Project. All Rights Reserved.