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:
- http://xml.org/sax/features/namespaces
- 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
isUnchangedByNormalization
protected int isUnchangedByNormalization(org.apache.xerces.xni.XMLString value)
Checks whether this string would be unchanged by normalization.
- isUnchangedByNormalization in interface XMLScanner
- -1 if the value would be unchanged by normalization,
otherwise the index of the first whitespace character which
would be transformed.
normalizeWhitespace
protected void normalizeWhitespace(org.apache.xerces.xni.XMLString value)
Normalize whitespace in an XMLString converting all whitespace
characters to space characters.
- 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.
- 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)* "'"
- scanAttributeValue in interface XMLScanner
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.
- 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.
- scanContent in interface XMLDocumentFragmentScannerImpl
- 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.
- scanPubidLiteral in interface XMLScanner
literal
- The string to fill in with the public ID literal.
- True on success.
Note: This method uses fStringBuffer, anything in it at
the time of calling is lost.