|
Class: SAXBuilder (in XML)
Object
|
+--XML::XMLNodeBuilder
|
+--XML::NodeBuilder
|
+--XML::SAXBuilder
- Package:
- stx:goodies/xml/vw
- Category:
- XML-VW-SAX
- Version:
- rev:
1.11
date: 2022/01/31 15:50:40
- user: cg
- file: SAXBuilder.st directory: goodies/xml/vw
- module: stx stc-classLibrary: vw
Author: Roger Whitney whitney@cs.sdsu.edu
Version: 1.0
Date: 4/2/2000
ORSAXBuilder is a bridge between an VWXMLXMLParser and an VWXMLSAXDriver. It intercepts calls from the parser
and sends the proper message to the SAXDriver.
Implementation notes: The XML parser uses the builder in building a tree structure for a document.
The final tree structure is not used by ORSAXBuilder because the final tree does not contain the
processing instructions. So the ORSAXBuilder intercepts build calls to infer the document structure.
It must cache attribute calls and the current tag as the Parser provides the separately, while the SAXDrvier
wants the tag will all the attributes in one call. The hard part of ths class is determing when we have all the attributes
for the current tag.
Instance Variables:
attributes <Collection> builds up list of attribures for the current tag
pendingTag <VWXMLNodeTag> The current we are collecting the attributes for. nil value indicates
that we are between tags.
saxDriver <VWXMLSAXDriver>
instance creation
-
> driver:source:">driver: aVWXMLSAXDriver source: aStream
-
accessing
-
> driver">driver
-
-
> pushTag:whileDoing:">pushTag: tag whileDoing: aBlock
-
Starting a new tag. aBlock may call this method
building
-
> attribute:value:">attribute: name value: value
-
Accumulate all attributes for a single start tag
-
> comment:">comment: text
-
Handle the comment of a tag
-
> externalGeneralEntity:id:ndata:uri:">externalGeneralEntity: nameString id: arrayIDs ndata: ndata uri: anURI
-
(comment from inherited method)
Needed for SAX. REW
-
> externalParameterEntity:id:">externalParameterEntity: nameString id: arrayIDs
-
(comment from inherited method)
Needed for SAX. REW
-
> makeText:">makeText: text
-
Handle the text content of a tag
-
> notation:value:">notation: name value: val
-
-
> pi:text:">pi: nm text: text
-
initialization
-
> initializeDriver:source:">initializeDriver: aVWXMLSAXDriver source: aStream
-
private
-
> char:startsSkipableWhiteSpaceIn:">char: aChar startsSkipableWhiteSpaceIn: aStream
-
used to determine if whitespace is skipable
-
> collectTextIn:">collectTextIn: aStream
-
collects text from current position upto ignorable whitespace
-
> collectWhitespaceIn:">collectWhitespaceIn: aStream
-
collects contigous whitespace from current position
-
> notifyClientEndElement:">notifyClientEndElement: currentTag
-
-
> notifyClientStartElement:">notifyClientStartElement: currentTag
-
-
> separateIgnorableWhitespaceAndText:">separateIgnorableWhitespaceAndText: aString
-
queries
-
> isTreeBuilding">isTreeBuilding
-
answer true, if our builder wants the XML parser to build
a tree of elements.
We do not need the tree, so answer false
|