::class xmlParser public
CLASS: xmlParser
A non-validating simple XML parser. The parser recognizes the following:
- Document start, when a XML file has been stringified and when the parseSting method has accepted the
string.
- XML Comments, no test for not allowed comment nesting.
- Removable White Space is removed when encountered.
- Processing Instructions (PI's), split into target (e.g. xml in <?xml version....?>) and data.
- CDATA with it's raw unparsed text.
- Attribute only tags, with their parsed, but without namespace checking, attributes.
- Tags with atributes as above and their parsed (i.e. resolved entities) text content.
- Document end, when the end of the XML string has been reached.
Definition at line
2882 of
xmlDOM.cls
Public Methods
|
|
init
(domBuilder)
|
|
|
domDocument - the DOM created from the input stream or .nil in case of errors
|
parseStream
(xmlStream)
|
|
|
domDocument - the DOM created by the builder or .nil in case of errors.
|
parseString
(xml)
|
|
|
text - The string with whitespace removed, if there was any.
|
removeIgnorableWhiteSpace
(text)
|
|
|
Instantiated by
tryxmldom.rex line 16
Feature Detail
The DOM builder given as parameter at instance creation time
Dynamically referenced by
xmlDOM.cls line 2893 "
self~domBuilder = domBuilder"
xmlDOM.cls line 2917 "
self~domBuilder~startDocument"
xmlDOM.cls line 2938 "
self~domBuilder~haveText(self~resolveEntities(text))"
xmlDOM.cls line 2946 "
self~domBuilder~haveComment(comment)"
xmlDOM.cls line 2951 "
self~domBuilder~havePI(target, data)"
xmlDOM.cls line 2956 "
self~domBuilder~haveCDATA(rawText)"
xmlDOM.cls line 2961 "
self~domBuilder~startElement(tagName)"
xmlDOM.cls line 2964 "
self~domBuilder~endElement(tagName)"
xmlDOM.cls line 2969 "
self~domBuilder~endElement(tagName)"
xmlDOM.cls line 2974 "
self~domBuilder~startElement(tagName)"
xmlDOM.cls line 2980 "
self~domBuilder~endDocument"
xmlDOM.cls line 2981 "
return self~domBuilder~doc"
xmlDOM.cls line 3001 "
self~domBuilder~nameAttr(attrName)"
xmlDOM.cls line 3002 "
self~domBuilder~valueAttr(self~resolveEntities(attrValue))"
The xmlParser constructor.
Parameters
domBuilder - the DOM builder the parser should use
Converts a XML file or stream into a string and passes the string on to
parseString.
Parameters
xmlStream - An object with a
supplier method
Returns
domDocument - the DOM created from the input stream or
.nil in case of errors
Dynamically referenced by
tryxmldom.rex line 17 "
dom = parser~parseStream(xmlStream)"
Analyzes the input string for situations the DOM builder wants to know about and invokes the appropiate methods for
the builder to handle the situations.
Parameters
xml - the XML string to be parsed.
Returns
domDocument - the DOM created by the builder or
.nil in case of errors.
Dynamically referenced by
xmlDOM.cls line 2908 "
return self~parseString(xml)"
Processes the attributes specified within an element tag and passes them on the the builder.
Parameters
attributes - the string containing all the attributes specifications within an element tag.
Dynamically referenced by
xmlDOM.cls line 2963 "
self~parseAttributes(self~removeIgnorableWhiteSpace(attributes))"
xmlDOM.cls line 2976 "
self~parseAttributes(self~removeIgnorableWhiteSpace(attributes))"
Returns a string with whitespace removed.
Parameters
text - A string with embedded whitespace, perhaps
Returns
text - The string with whitespace removed, if there was any.
Dynamically referenced by
xmlDOM.cls line 2937 "
if self~removeIgnorableWhiteSpace(text)<>''"
xmlDOM.cls line 2963 "
self~parseAttributes(self~removeIgnorableWhiteSpace(attributes))"
xmlDOM.cls line 2976 "
self~parseAttributes(self~removeIgnorableWhiteSpace(attributes))"
Transforms (the standard) entities to their character representation.
NOTE - As DOCTYPE is not supported (yet) no DOCTYPE defined entities are handled.
Parameters
text - A string possibly with entities.
Returns
text - The string with entities resolved if any.
Dynamically referenced by
xmlDOM.cls line 2938 "
self~domBuilder~haveText(self~resolveEntities(text))"
xmlDOM.cls line 3002 "
self~domBuilder~valueAttr(self~resolveEntities(attrValue))"
|
Generated on 30 Jul 2015 13:57:00 for xmlDOM for OOrexx by
0.0.1
|