serializer.xmlsaxstream - Palamecia/mint GitHub Wiki
load serializer.xmlsaxstream
This module provides the Serializer.XmlSaxStream class which allow to read and write XML documents with a SAX algorithm.
This class provides an interface to handle Serializer.XmlSaxStream events.
Modifiers | Member | Description |
---|---|---|
onCData | The reader calls this function when it has parsed a chunk of character data i... | |
onCharacters | The reader calls this function when it has parsed a chunk of normal character ... | |
onComment | The reader calls this function when it has parsed a comment. The comment cont... | |
onDtd | The reader calls this function when it has parsed a chunk of character data i... | |
onEndDocument | The reader calls this function after it has finished parsing. It is called ju... | |
onEndElement | The reader calls this function when it has parsed an end element tag with the... | |
onProcessingInstruction | The reader calls this function when it has parsed a processing instruction. T... | |
onStartDocument | The reader calls this function when it starts parsing the document. The reade... | |
onStartElement | The reader calls this function when it has parsed a start element tag. The ta... |
This class class provides a way to read and write XML documents using a SAX algorithm.
Modifiers | Member | Description |
---|---|---|
const |
getHandle | Returns the handle used to handle XML content. |
const |
new | Creates a new stream for reading and writing data using stream . |
override const
|
read | Reads the content of the stream. Returns true if all encountred events have b... |
const |
setHandle | Sets the handle used to handle XML content. |
Modifiers | Member | Description |
---|---|---|
final |
handle | Internal read handle. |
def (self, content)
The reader calls this function when it has parsed a chunk of character data
inside a CDATA section. The character data is given through the content
parameter. The default implementation calls onCharacters.
If this function returns false
the reader stops parsing and report an
unfinished parsing.
def (self, content)
The reader calls this function when it has parsed a chunk of normal character
data. The character data is given through the content
parameter.
If this function returns false
the reader stops parsing and report an
unfinished parsing.
def (self, content)
The reader calls this function when it has parsed a comment. The comment
content is given through the content
parameter.
If this function returns false
the reader stops parsing and report an
unfinished parsing.
def (self, content)
The reader calls this function when it has parsed a chunk of character data
inside a DTD section. The character data is given through the content
parameter.
If this function returns false
the reader stops parsing and report an
unfinished parsing.
def (self)
The reader calls this function after it has finished parsing. It is called just once, and is the last handler function called. It is called after the reader has read all input.
If this function returns false
the reader stops parsing and report an
unfinished parsing.
def (self, namespaceUri, localName, qualifiedName)
The reader calls this function when it has parsed an end element tag with
the name localName
.
If this function returns false
the reader stops parsing and report an
unfinished parsing.
def (self, name, attributes)
The reader calls this function when it has parsed a processing instruction.
The target name is given through the name
parameter and each attributes
of the data is inserted in an hash (name to value) and passed through the
attributes
parameter.
If this function returns false
the reader stops parsing and report an
unfinished parsing.
def (self)
The reader calls this function when it starts parsing the document. The reader calls this function just once.
If this function returns false
the reader stops parsing and report an
unfinished parsing.
def (self, namespaceUri, localName, qualifiedName, attributes)
The reader calls this function when it has parsed a start element tag.
The tag name is given through the localName
parameter and each attributes
of the tag is inserted in an hash (name to value) and passed through the
attributes
parameter.
There is a corresponding onEndElement call when the corresponding
end element tag is read. The onStartElement and onEndElement
calls are always nested correctly. Empty element tags (e.g. <.../>
)
cause a onStartElement call to be immediately followed by an
onEndElement call.
If this function returns false
the reader stops parsing and report an
unfinished parsing.
def (const self)
Returns the handle used to handle XML content.
none
Internal read handle.
def (self, stream)
Creates a new stream for reading and writing data using stream
.
def (self)
Reads the content of the stream. Returns true
if all encountred events
have been correctly handled by the handler; otherwise returns false
.
If the content of the stream is not a valid XML, an instance of
Serializer.DocumentStream.InvalidDocument is raised.
def (self, handle)
Sets the handle used to handle XML content.