org.apache.xerces.impl
Class XMLNSDocumentScannerImpl
- org.apache.xerces.xni.parser.XMLDocumentScanner, org.apache.xerces.xni.parser.XMLComponent, XMLEntityHandler
public class XMLNSDocumentScannerImpl
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
$Id: XMLNSDocumentScannerImpl.java 320089 2004-10-04 21:45:49Z mrglavas $
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.
|
DISALLOW_DOCTYPE_DECL_FEATURE , DTD_SCANNER , LOAD_EXTERNAL_DTD , NAMESPACE_CONTEXT , 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 , fDTDDispatcher , fDTDScanner , fDisallowDoctype , fDoctypeName , fDoctypePublicId , fDoctypeSystemId , fLoadExternalDTD , fNamespaceContext , fPrologDispatcher , fScanningDTD , fSeenDoctypeDecl , fTrailingMiscDispatcher , fValidationManager , fXMLDeclDispatcher |
DEBUG_CONTENT_SCANNING , ENTITY_RESOLVER , 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 , fAttributeQName , fAttributes , fContentDispatcher , fCurrentElement , fDispatcher , fDocumentHandler , fElementQName , fElementStack , fEntityStack , fExternalSubsetResolver , fHasExternalDTD , fInScanContent , fMarkupDepth , fNotifyBuiltInRefs , fScannerState , fStandalone , fTempString , fTempString2 |
DEBUG_ATTR_NORMALIZATION , ENTITY_MANAGER , ERROR_REPORTER , NAMESPACES , NOTIFY_CHAR_REFS , PARSER_SETTINGS , SYMBOL_TABLE , VALIDATION , fAmpSymbol , fAposSymbol , fCharRefLiteral , fEncodingSymbol , fEntityDepth , fEntityManager , fEntityScanner , fErrorReporter , fGtSymbol , fLtSymbol , fNamespaces , fNotifyCharRefs , fParserSettings , fQuotSymbol , fReportEntity , fResourceIdentifier , fScanningAttribute , fStandaloneSymbol , fSymbolTable , fValidation , fVersionSymbol |
createContentDispatcher , endEntity , getFeatureDefault , getPropertyDefault , getRecognizedFeatures , getRecognizedProperties , getScannerStateName , reset , scanDoctypeDecl , setFeature , setInputSource , setProperty , startEntity |
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 |
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 |
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.
reset
public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
throws org.apache.xerces.xni.parser.XMLConfigurationException
- reset in interface org.apache.xerces.xni.parser.XMLComponent
- reset in interface XMLDocumentScannerImpl
scanAttribute
protected void scanAttribute(XMLAttributesImpl attributes)
throws 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.
attributes
- The attributes list for the scanned attribute.
scanEndElement
protected int scanEndElement()
throws 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.
- scanEndElement in interface XMLDocumentFragmentScannerImpl
scanStartElement
protected boolean scanStartElement()
throws 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.
- scanStartElement in interface XMLDocumentFragmentScannerImpl
- True if element is empty. (i.e. It matches
production [44].
scanStartElementAfterName
protected boolean scanStartElementAfterName()
throws IOException,
org.apache.xerces.xni.XNIException
Scans the remainder of a start or empty tag after the element name.
- scanStartElementAfterName in interface XMLDocumentFragmentScannerImpl
- True if element is empty.
setDTDValidator
public void setDTDValidator(XMLDTDValidatorFilter dtd)
The scanner is responsible for removing DTD validator
from the pipeline if it is not needed.
Copyright B) 1999-2006 The Apache Software Foundation. All Rights Reserved.