java.lang.Object | |
↳ | org.apache.xerces.impl.XMLScanner |
Known Direct Subclasses |
Known Indirect Subclasses |
This class is responsible for holding scanning methods common to scanning the XML document structure and content as well as the DTD structure and content. Both XMLDocumentScanner and XMLDTDScanner inherit from this base class.
This component requires the following features and properties from the component manager that uses it:
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | DEBUG_ATTR_NORMALIZATION | Debug attribute normalization. | |||||||||
String | ENTITY_MANAGER | Property identifier: entity manager. | |||||||||
String | ERROR_REPORTER | Property identifier: error reporter. | |||||||||
String | NAMESPACES | Feature identifier: namespaces. | |||||||||
String | NOTIFY_CHAR_REFS | Feature identifier: notify character references. | |||||||||
String | PARSER_SETTINGS | ||||||||||
String | SYMBOL_TABLE | Property identifier: symbol table. | |||||||||
String | VALIDATION | Feature identifier: validation. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fAmpSymbol | Symbol: "amp". | ||||||||||
fAposSymbol | Symbol: "apos". | ||||||||||
fCharRefLiteral | Literal value of the last character refence scanned. | ||||||||||
fEncodingSymbol | Symbol: "encoding". | ||||||||||
fEntityDepth | Entity depth. | ||||||||||
fEntityManager | Entity manager. | ||||||||||
fEntityScanner | Entity scanner. | ||||||||||
fErrorReporter | Error reporter. | ||||||||||
fGtSymbol | Symbol: "gt". | ||||||||||
fLtSymbol | Symbol: "lt". | ||||||||||
fNamespaces | Namespaces. | ||||||||||
fNotifyCharRefs | Character references notification. | ||||||||||
fParserSettings | Internal parser-settings feature | ||||||||||
fQuotSymbol | Symbol: "quot". | ||||||||||
fReportEntity | Report entity boundary. | ||||||||||
fResourceIdentifier | |||||||||||
fScanningAttribute | Scanning attribute. | ||||||||||
fStandaloneSymbol | Symbol: "standalone". | ||||||||||
fSymbolTable | Symbol table. | ||||||||||
fValidation | Validation. | ||||||||||
fVersionSymbol | Symbol: "version". |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method notifies the end of an entity.
| |||||||||||
Resets the component.
| |||||||||||
Scans a pseudo attribute.
| |||||||||||
Sets the state of a feature.
| |||||||||||
Sets the value of a property during parsing.
| |||||||||||
This method notifies of the start of an entity.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks whether this string would be unchanged by normalization.
| |||||||||||
Normalize whitespace in an XMLString converting all whitespace
characters to space characters.
| |||||||||||
Normalize whitespace in an XMLString converting all whitespace
characters to space characters.
| |||||||||||
Convenience function used in all XML scanners.
| |||||||||||
Scans an attribute value and normalizes whitespace converting all
whitespace characters to space characters.
| |||||||||||
Scans a character reference and append the corresponding chars to the
specified buffer.
| |||||||||||
Scans a comment.
| |||||||||||
Scans External ID and return the public and system IDs.
| |||||||||||
Scans a processing instruction.
| |||||||||||
Scans a processing data.
| |||||||||||
Scans public ID literal.
| |||||||||||
Scans surrogates and append them to the specified buffer.
| |||||||||||
Scans an XML or text declaration.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.xerces.xni.parser.XMLComponent
|
Debug attribute normalization.
Property identifier: entity manager.
Property identifier: error reporter.
Feature identifier: namespaces.
Feature identifier: notify character references.
Property identifier: symbol table.
Feature identifier: validation.
Entity depth.
Namespaces.
Character references notification.
Internal parser-settings feature
Report entity boundary.
Scanning attribute.
Validation. This feature identifier is: http://xml.org/sax/features/validation
This method notifies the end of an entity. The document entity has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entities are just specified by their name.
name | The name of the entity. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.
componentManager | The component manager. |
---|
Throws exception if required features and properties cannot be found. | |
XMLConfigurationException |
Scans a pseudo attribute.
scanningTextDecl | True if scanning this pseudo-attribute for a TextDecl; false if scanning XMLDecl. This flag is needed to report the correct type of error. |
---|---|
value | The string to fill in with the attribute value. |
IOException | |
---|---|
XNIException |
Sets the state of a feature. This method is called by the component manager any time after reset when a feature changes state.
Note: Components should silently ignore features that do not affect the operation of the component.
featureId | The feature identifier. |
---|---|
value | The state of the feature. |
XMLConfigurationException |
---|
Sets the value of a property during parsing.
propertyId | The property identifier. |
---|---|
value | The value of the property. |
XMLConfigurationException |
---|
This method notifies of the start of an entity. The document entity has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entities are just specified by their name.
name | The name of the entity. |
---|---|
identifier | The resource identifier. |
encoding | The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal entities or a document entity that is parsed from a java.io.Reader). |
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
Checks whether this string would be unchanged by normalization.
Normalize whitespace in an XMLString converting all whitespace characters to space characters.
Normalize whitespace in an XMLString converting all whitespace characters to space characters.
Convenience function used in all XML scanners.
XNIException |
---|
Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters. [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
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. |
IOException | |
---|---|
XNIException |
Scans a character reference and append the corresponding chars to the specified buffer.
[66] CharRef ::= '' [0-9]+ ';' | '' [0-9a-fA-F]+ ';'Note: This method uses fStringBuffer, anything in it at the time of calling is lost.
buf | the character buffer to append chars to |
---|---|
buf2 | the character buffer to append non-normalized chars to |
IOException | |
---|---|
XNIException |
Scans a comment.
[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Note: Called after scanning past '<!--' Note: This method uses fString, anything in it at the time of calling is lost.
text | The buffer to fill in with the text. |
---|
IOException | |
---|---|
XNIException |
Scans External ID and return the public and system IDs.
identifiers | An array of size 2 to return the system id, and public id (in that order). |
---|---|
optionalSystemId | Specifies whether the system id is optional. Note: This method uses fString and fStringBuffer, anything in them at the time of calling is lost. |
IOException | |
---|---|
XNIException |
Scans a processing instruction.
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))Note: This method uses fString, anything in it at the time of calling is lost.
IOException | |
---|---|
XNIException |
Scans a processing data. This is needed to handle the situation where a document starts with a processing instruction whose target name starts with "xml". (e.g. xmlfoo) Note: This method uses fStringBuffer, anything in it at the time of calling is lost.
target | The PI target |
---|---|
data | The string to fill in with the data |
IOException | |
---|---|
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.
literal | The string to fill in with the public ID literal. |
---|
IOException | |
---|---|
XNIException |
Scans surrogates and append them to the specified buffer.
Note: This assumes the current char has already been identified as a high surrogate.
buf | The StringBuffer to append the read surrogates to. |
---|
IOException | |
---|---|
XNIException |
Scans an XML or text declaration.
[23] XMLDecl ::= '' [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ") [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" ) [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')* [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"')) [77] TextDecl ::= ''
scanningTextDecl | True if a text declaration is to be scanned instead of an XML declaration. |
---|---|
pseudoAttributeValues | An array of size 3 to return the version, encoding and standalone pseudo attribute values (in that order). Note: This method uses fString, anything in it at the time of calling is lost. |
IOException | |
---|---|
XNIException |