serializer.xmlsaxstream - Palamecia/mint GitHub Wiki

Module

load serializer.xmlsaxstream

This module provides the Serializer.XmlSaxStream class which allow to read and write XML documents with a SAX algorithm.

Packages

Classes

Serializer.XmlSaxHandle

This class provides an interface to handle Serializer.XmlSaxStream events.

Members

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...

Serializer.XmlSaxStream

This class class provides a way to read and write XML documents using a SAX algorithm.

Inherits

Members

Modifiers Member Description
+ const getHandle Returns the handle used to handle XML content.
- final handle Internal read handle.
+ 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...
+ const setHandle Sets the handle used to handle XML content.

Descriptions

Serializer.XmlSaxHandle.onCData

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.

Serializer.XmlSaxHandle.onCharacters

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.

Serializer.XmlSaxHandle.onComment

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.

Serializer.XmlSaxHandle.onDtd

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.

Serializer.XmlSaxHandle.onEndDocument

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.

Serializer.XmlSaxHandle.onEndElement

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.

Serializer.XmlSaxHandle.onProcessingInstruction

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.

Serializer.XmlSaxHandle.onStartDocument

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.

Serializer.XmlSaxHandle.onStartElement

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.

Serializer.XmlSaxStream.getHandle

def (const self)

Returns the handle used to handle XML content.

Serializer.XmlSaxStream.handle

none

Internal read handle.

Serializer.XmlSaxStream.new

def (self, stream)

Creates a new stream for reading and writing data using stream.

Serializer.XmlSaxStream.read

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.

Serializer.XmlSaxStream.setHandle

def (self, handle)

Sets the handle used to handle XML content.

⚠️ **GitHub.com Fallback** ⚠️