org.apache.xerces.impl

Class XML11DocumentScannerImpl

Implemented Interfaces:
org.apache.xerces.xni.parser.XMLDocumentScanner, org.apache.xerces.xni.parser.XMLComponent, XMLEntityHandler
Known Direct Subclasses:
XML11NSDocumentScannerImpl

public class XML11DocumentScannerImpl
extends XMLDocumentScannerImpl

This class is responsible for scanning XML document structure and content. The scanner acts as the source for the document information which is communicated to the document handler.

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

Version:
$Id: XML11DocumentScannerImpl.java 354533 2005-12-06 20:12:10Z mrglavas $
Authors:
Glenn Marcy, IBM
Andy Clark, IBM
Arnaud Le Hors, IBM
Eric Ye, IBM

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.xerces.impl.XMLDocumentScannerImpl

XMLDocumentScannerImpl.ContentDispatcher, XMLDocumentScannerImpl.DTDDispatcher, XMLDocumentScannerImpl.PrologDispatcher, XMLDocumentScannerImpl.TrailingMiscDispatcher, XMLDocumentScannerImpl.XMLDeclDispatcher

Nested classes/interfaces inherited from class org.apache.xerces.impl.XMLDocumentFragmentScannerImpl

XMLDocumentFragmentScannerImpl.Dispatcher, XMLDocumentFragmentScannerImpl.ElementStack, XMLDocumentFragmentScannerImpl.FragmentContentDispatcher

Field Summary

Fields inherited from class org.apache.xerces.impl.XMLDocumentScannerImpl

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

Fields inherited from class org.apache.xerces.impl.XMLDocumentFragmentScannerImpl

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

Fields inherited from class org.apache.xerces.impl.XMLScanner

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

Constructor Summary

XML11DocumentScannerImpl()
Default constructor.

Method Summary

protected String
getVersionNotSupportedKey()
protected boolean
isInvalid(int value)
protected boolean
isInvalidLiteral(int value)
protected int
isUnchangedByNormalization(org.apache.xerces.xni.XMLString value)
Checks whether this string would be unchanged by normalization.
protected boolean
isValidNCName(int value)
protected boolean
isValidNameChar(int value)
protected boolean
isValidNameStartChar(int value)
protected boolean
isValidNameStartHighSurrogate(int value)
protected void
normalizeWhitespace(org.apache.xerces.xni.XMLString value)
Normalize whitespace in an XMLString converting all whitespace characters to space characters.
protected void
normalizeWhitespace(org.apache.xerces.xni.XMLString value, int fromIndex)
Normalize whitespace in an XMLString converting all whitespace characters to space characters.
protected boolean
scanAttributeValue(org.apache.xerces.xni.XMLString value, org.apache.xerces.xni.XMLString nonNormalizedValue, String atName, boolean checkEntities, String eleName)
Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters.
protected int
scanContent()
Scans element content.
protected boolean
scanPubidLiteral(org.apache.xerces.xni.XMLString literal)
Scans public ID literal.
protected boolean
versionSupported(String version)

Methods inherited from class org.apache.xerces.impl.XMLDocumentScannerImpl

createContentDispatcher, endEntity, getFeatureDefault, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, getScannerStateName, reset, scanDoctypeDecl, setFeature, setInputSource, setProperty, startEntity

Methods inherited from class 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 inherited from class 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

Constructor Details

XML11DocumentScannerImpl

public XML11DocumentScannerImpl()
Default constructor.

Method Details

getVersionNotSupportedKey

protected String getVersionNotSupportedKey()
Overrides:
getVersionNotSupportedKey in interface XMLScanner

isInvalid

protected boolean isInvalid(int value)
Overrides:
isInvalid in interface XMLScanner

isInvalidLiteral

protected boolean isInvalidLiteral(int value)
Overrides:
isInvalidLiteral in interface XMLScanner

isUnchangedByNormalization

protected int isUnchangedByNormalization(org.apache.xerces.xni.XMLString value)
Checks whether this string would be unchanged by normalization.
Overrides:
isUnchangedByNormalization in interface XMLScanner
Returns:
-1 if the value would be unchanged by normalization, otherwise the index of the first whitespace character which would be transformed.

isValidNCName

protected boolean isValidNCName(int value)
Overrides:
isValidNCName in interface XMLScanner

isValidNameChar

protected boolean isValidNameChar(int value)
Overrides:
isValidNameChar in interface XMLScanner

isValidNameStartChar

protected boolean isValidNameStartChar(int value)
Overrides:
isValidNameStartChar in interface XMLScanner

isValidNameStartHighSurrogate

protected boolean isValidNameStartHighSurrogate(int value)
Overrides:
isValidNameStartHighSurrogate in interface XMLScanner

normalizeWhitespace

protected void normalizeWhitespace(org.apache.xerces.xni.XMLString value)
Normalize whitespace in an XMLString converting all whitespace characters to space characters.
Overrides:
normalizeWhitespace in interface XMLScanner

normalizeWhitespace

protected void normalizeWhitespace(org.apache.xerces.xni.XMLString value,
                                   int fromIndex)
Normalize whitespace in an XMLString converting all whitespace characters to space characters.
Overrides:
normalizeWhitespace in interface XMLScanner

scanAttributeValue

protected boolean scanAttributeValue(org.apache.xerces.xni.XMLString value,
                                     org.apache.xerces.xni.XMLString nonNormalizedValue,
                                     String atName,
                                     boolean checkEntities,
                                     String eleName)
            throws IOException,
                   org.apache.xerces.xni.XNIException
Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters. [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
Overrides:
scanAttributeValue in interface XMLScanner
Parameters:
value - The XMLString to fill in with the value.
nonNormalizedValue - The XMLString to fill in with the non-normalized value.
atName - The name of the attribute being parsed (for error msgs).
checkEntities - true if undeclared entities should be reported as VC violation, false if undeclared entities should be reported as WFC violation.
eleName - The name of element to which this attribute belongs.
Returns:
true if the non-normalized and normalized value are the same Note: This method uses fStringBuffer2, anything in it at the time of calling is lost.

scanContent

protected int scanContent()
            throws IOException,
                   org.apache.xerces.xni.XNIException
Scans element content.
Overrides:
scanContent in interface XMLDocumentFragmentScannerImpl
Returns:
Returns the next character on the stream.

scanPubidLiteral

protected boolean scanPubidLiteral(org.apache.xerces.xni.XMLString literal)
            throws IOException,
                   org.apache.xerces.xni.XNIException
Scans public ID literal. [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] The returned string is normalized according to the following rule, from http://www.w3.org/TR/REC-xml#dt-pubid: Before a match is attempted, all strings of white space in the public identifier must be normalized to single space characters (#x20), and leading and trailing white space must be removed.
Overrides:
scanPubidLiteral in interface XMLScanner
Parameters:
literal - The string to fill in with the public ID literal.
Returns:
True on success. Note: This method uses fStringBuffer, anything in it at the time of calling is lost.

versionSupported

protected boolean versionSupported(String version)
Overrides:
versionSupported in interface XMLScanner

Copyright B) 1999-2006 The Apache Software Foundation. All Rights Reserved.