Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl

public Class XML11DocumentScannerImpl

extends XMLDocumentScannerImpl
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xerces.internal.impl.XML11NSDocumentScannerImpl
Imports
java.io.IOException, com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter, com.sun.org.apache.xerces.internal.util.XML11Char, .XMLChar, .XMLStringBuffer, com.sun.org.apache.xerces.internal.xni.XMLString, .XNIException

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:

Authors
Glenn Marcy, IBM, Andy Clark, IBM, Arnaud Le Hors, IBM, Eric Ye, IBM

Field Summary

Modifier and TypeField and Description
private final XMLStringBuffer
private final XMLStringBuffer
private final XMLStringBuffer
Inherited from com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl:
DISALLOW_DOCTYPE_DECL_FEATUREDOCUMENT_SCANNERDTD_SCANNERfAddedListenerfDoctypeNamefDoctypePublicIdfDoctypeSystemIdfDTDDeclfDTDDriverfDTDScannerfEndPosfLoadExternalDTDfNamespaceContextfPrologDriverfReadingDTDfScanEndElementfSeenDoctypeDeclfSeenInternalSubsetfStartPosfTrailingMiscDriverfValidationManagerfXMLDeclDriverLOAD_EXTERNAL_DTDNAMESPACE_CONTEXTSCANNER_STATE_DTD_EXTERNALSCANNER_STATE_DTD_EXTERNAL_DECLSSCANNER_STATE_DTD_INTERNAL_DECLSSCANNER_STATE_NO_SUCH_ELEMENT_EXCEPTIONSCANNER_STATE_PROLOGSCANNER_STATE_TRAILING_MISCSCANNER_STATE_XML_DECLVALIDATION_MANAGER

Constructor Summary

AccessConstructor and Description
public
XML11DocumentScannerImpl()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
protected String
protected boolean
protected boolean
protected int

Returns:

-1 if the value would be unchanged by normalization, otherwise the index of the first whitespace character which would be transformed.
isUnchangedByNormalization
(XMLString value)

Checks whether this string would be unchanged by normalization.

protected boolean
protected boolean
protected boolean
protected boolean
protected void
normalizeWhitespace(XMLString value)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.normalizeWhitespace.

Normalize whitespace in an XMLString converting all whitespace characters to space characters.

protected void
normalizeWhitespace(XMLString value, int fromIndex)

Normalize whitespace in an XMLString converting all whitespace characters to space characters.

protected boolean

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.

scanAttributeValue
(XMLString
The XMLString to fill in with the value.
value
,
XMLString
The XMLString to fill in with the non-normalized value.
nonNormalizedValue
,
String
The name of the attribute being parsed (for error msgs).
atName
,
boolean
true if undeclared entities should be reported as VC violation, false if undeclared entities should be reported as WFC violation.
checkEntities
,
String
The name of element to which this attribute belongs.
eleName
,
boolean
The flag indicating whether the content is a namespace URI
isNSURI
)

Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters.

protected int

Returns:

Returns the next character on the stream.
scanContent
(XMLStringBuffer content)

Overrides com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanContent.

Scans element content.

protected boolean

Returns:

True on success

Note

This method uses fStringBuffer, anything in it at the time of calling is lost.

scanPubidLiteral
(XMLString
The string to fill in with the public ID literal.
literal
)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPubidLiteral.

Scans public ID literal.

protected boolean
Inherited from com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl:
createContentDriverendEntitygetCharacterEncodingSchemegetDTDDeclgetFeatureDefaultgetNamespaceContextgetPropertyDefaultgetRecognizedFeaturesgetRecognizedPropertiesgetScannerStateNamegetScannetStatenextrefreshresetresetscanDoctypeDeclsetEndDTDScanStatesetFeaturesetInputSourcesetPropertystartEntity

Field Detail

fStringBufferback to summary
private final XMLStringBuffer fStringBuffer

Hides com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.fStringBuffer.

String buffer.

fStringBuffer2back to summary
private final XMLStringBuffer fStringBuffer2

Hides com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.fStringBuffer2.

fStringBuffer3back to summary
private final XMLStringBuffer fStringBuffer3

Hides com.sun.org.apache.xerces.internal.impl.XMLScanner.fStringBuffer3.

Constructor Detail

XML11DocumentScannerImplback to summary
public XML11DocumentScannerImpl()

Default constructor.

Method Detail

getVersionNotSupportedKeyback to summary
protected String getVersionNotSupportedKey()
isInvalidback to summary
protected boolean isInvalid(int value)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.isInvalid.

isInvalidLiteralback to summary
protected boolean isInvalidLiteral(int value)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.isInvalidLiteral.

isUnchangedByNormalizationback to summary
protected int isUnchangedByNormalization(XMLString value)

Checks whether this string would be unchanged by normalization.

Returns:int

-1 if the value would be unchanged by normalization, otherwise the index of the first whitespace character which would be transformed.

isValidNameCharback to summary
protected boolean isValidNameChar(int value)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.isValidNameChar.

isValidNameStartCharback to summary
protected boolean isValidNameStartChar(int value)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.isValidNameStartChar.

isValidNameStartHighSurrogateback to summary
protected boolean isValidNameStartHighSurrogate(int value)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.isValidNameStartHighSurrogate.

isValidNCNameback to summary
protected boolean isValidNCName(int value)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.isValidNCName.

normalizeWhitespaceback to summary
protected void normalizeWhitespace(XMLString value)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.normalizeWhitespace.

Normalize whitespace in an XMLString converting all whitespace characters to space characters.

normalizeWhitespaceback to summary
protected void normalizeWhitespace(XMLString value, int fromIndex)

Normalize whitespace in an XMLString converting all whitespace characters to space characters.

scanAttributeValueback to summary
protected boolean scanAttributeValue(XMLString value, XMLString nonNormalizedValue, String atName, boolean checkEntities, String eleName, boolean isNSURI) throws IOException, XNIException

Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters. [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"

Parameters
value:XMLString

The XMLString to fill in with the value.

nonNormalizedValue:XMLString

The XMLString to fill in with the non-normalized value.

atName:String

The name of the attribute being parsed (for error msgs).

checkEntities:boolean

true if undeclared entities should be reported as VC violation, false if undeclared entities should be reported as WFC violation.

eleName:String

The name of element to which this attribute belongs.

isNSURI:boolean

The flag indicating whether the content is a namespace URI

Returns:boolean

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.

scanContentback to summary
protected int scanContent(XMLStringBuffer content) throws IOException, XNIException

Overrides com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanContent.

Scans element content.

Returns:int

Returns the next character on the stream.

scanPubidLiteralback to summary
protected boolean scanPubidLiteral(XMLString literal) throws IOException, XNIException

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.scanPubidLiteral.

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.

Parameters
literal:XMLString

The string to fill in with the public ID literal.

Returns:boolean

True on success

Note

This method uses fStringBuffer, anything in it at the time of calling is lost.

versionSupportedback to summary
protected boolean versionSupported(String version)

Overrides com.sun.org.apache.xerces.internal.impl.XMLScanner.versionSupported.