serializer.xmlstream - Palamecia/mint GitHub Wiki

Module

load serializer.xmlstream

This module provides the Serializer.XmlStream class which allow to read and write XML documents.

Packages

Enums

Serializer.XmlStream.ReadElementTextBehaviour

This enum describe the behaviour of the readElementText method when a child element is encountred.

Constant Value Description
ErrorOnUnexpectedElement 0 The children elements makes the stream raises an instance of Serializer.Docum...
IncludeChildElements 1 The children elements are included in the element text.
SkipChildElements 2 The children elements are ignored.

Serializer.XmlStream.Reader.State

This enum describe the current state of the parser. The values of this enum will be used to check how to handle the next character.

Constant Value Description
ReadAttributeName 15 Reading a tag attribute name (<... ... )
ReadAttributeValue 16 Reading a tag attribute value (<... ...="..." )
ReadCDataOpen 4 Reading a CDATA open token (<![CDATA[ )
ReadCDataValue 5 Reading the content of a CDATA (<![CDATA[...]]> )
ReadCharacters 3 Reading character inside a markup (<tag>...</tag> )
ReadComment 2 Reading a comment (<!-- ... --> )
ReadDtdOpen 6 Reading a DTD open token (<!DOCTYPE )
ReadDtdValue 7 Reading the content of a DTD (<!DOCTYPE ... [ ... ]> )
ReadNext 0 Waiting for a new element
ReadOpen 1 Reading an opening token (< )
ReadProcessingInstructionAttributeName 10 Reading a processing instruction attribute name (<?... ... )
ReadProcessingInstructionAttributeValue 11 Reading a processing instruction attribute value (<?... ...="..." )
ReadProcessingInstructionTagEnd 8 Reading a processing instruction close token (?> )
ReadProcessingInstructionTagName 9 Reading a processing instruction tag name (<?... )
ReadTagEnd 12 Reading a tag close token (</...> )
ReadTagEndEmpty 13 Reading an empty tag close token (<.../> )
ReadTagName 14 Reading a tag name (<... )

Serializer.XmlStream.TokenType

Constant Value Description
CDATA 8
Characters 6
Comment 7
DTD 9
EndDocument 3
EndElement 5
Invalid 0
ProcessingInstruction 1
StartDocument 2
StartElement 4

Classes

Serializer.XmlAttribute

This class is the representation of an XML attribute.

Members

Modifiers Member Description
+ const != Returns false if other is the same attribute than self; otherwise retur...
+ const == Returns true if other is the same attribute than self; otherwise return...
+ const getLocalName Returns the local name of the attribute.
+ const getNamespaceUri Returns the namespace URI of the attribute.
+ const getPrefix Returns the prefix (namespace) of the attribute.
+ const getQualifiedName Returns the qualified name of the attribute (prefix + name).
+ const getValue Returns the value of the attribute.
- final localName Internal attribute name.
- final namespaceUri Internal attribute namespace URI.
+ const new Creates a new empty attribute.
- final qualifiedName Internal attribute qualified name.
+ const setValue Sets the value of the attribute to value.
+ const toString Returns the string representation of the attribute.
- final value Internal attribute value.

Serializer.XmlAttributes

This class is the representation of an element's XML attributes.

Members

Modifiers Member Description
+ const != Returns true if other is not equal to this list of attributes; otherwise ...
+ const := Copies the attributes contained in other into self then returns self.
+ const << Inserts attr at the end of the list.
+ const == Returns true if other is equal to this list of attributes; otherwise retu...
+ const [] Returns the attribute at the given index.
+ const []= Sets the value of the first attribute with the given qualifiedName to val...
- final attributes Internal attributes.
+ const clear Removes all the attributes of the list.
+ const contains Returns true if the list contains an attribute with the given qualifiedNa...
+ const containsNS Returns true if the list contains an attribute with the givens namespaceU...
+ const get Returns the first attribute with the given qualifiedName.
+ const getNS Returns the first attribute with the givens namespaceUri and localName.
+ const in Returns true if the list contains an attribute with the given qualifiedNa...
+ const indexOf Returns the index position of the first attribute with the given qualifiedN...
+ const indexOfNS Returns the index position of the first attribute with the givens namespace...
+ const insert Creates a new attribute with the given qualifiedName and value at the giv...
+ const insertNS Creates a new attribute with the given namespaceUri, qualifiedName and ``...
+ const isEmpty Returns true if the list is empty; otherwise returns false.
+ const remove Removes the first attribute with the given qualifiedName.
+ const removeNS Removes the first attribute with the givens namespaceUri and localName.
+ const size Returns the number of attributes in the list.
+ const toString Returns the string representation of the attribute list.
+ const value Returns the value of the first attribute with the given qualifiedName. Retu...
+ const valueNS Returns the value of the first attribute with the givens namespaceUri and ...

Serializer.XmlStream

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

Inherits

Members

Modifiers Member Description
+ const << Writes the content of data to the stream using the write function, then ret...
+ enum ReadElementTextBehaviour This enum describe the behaviour of the readElementText method when a child e...
- class Reader This class provides a parser to convert an XML stream to tokens.
+ enum TokenType
- class Writer This class provides a writer to convert events to formated XML into a stream.
+ @ const escapeString Returns the content of str with special characters escaped to be inserted i...
+ const getAttributes Returns current element's attributs as instances of Serializer.XmlAttributes.
+ const getDocumentEncoding Returns the name of the encoding used by the document.
+ const getDocumentVersion Returns the version of the XML standard used by the document.
+ const getLocalName Returns the name of the current element.
+ const getNamespaceUri Returns the namespace URI of the current element.
+ const getPrefix Returns the prefix (namespace) of the current element.
+ const getProcessingInstructionData Returns the current processing instruction's data as instances of Serializer....
+ const getProcessingInstructionTarget Returns the current processing instructions's target.
+ const getQualifiedName Returns the qualified name of the current element (prefix + name).
+ const getText Returns the current texte.
+ const getTokenString Returns the last read token's text as a string.
+ const getTokenType Returns the last read token's type as a value of Serializer.XmlSaxStream.Toke...
+ const isAutoClosing Returns true if the stream automaticaly close the markups when writing; oth...
+ const isCDATA Returns true if the last read token's type is Serializer.XmlStream.TokenTyp...
+ const isCharacters Returns true if the last read token's type is Serializer.XmlStream.TokenTyp...
+ const isComment Returns true if the last read token's type is Serializer.XmlStream.TokenTyp...
+ const isDTD Returns true if the last read token's type is Serializer.XmlStream.TokenTyp...
+ const isEndDocument Returns true if the last read token's type is Serializer.XmlStream.TokenTyp...
+ const isEndElement Returns true if the last read token's type is Serializer.XmlStream.TokenTyp...
+ const isIndented Returns true if the stream indent the XML when writing; otherwise returns ...
+ const isProcessingInstruction Returns true if the last read token's type is Serializer.XmlStream.TokenTyp...
+ const isStandaloneDocument Returns true if the standalone attribute of the document is set; otherwise ...
+ const isStartDocument Returns true if the last read token's type is Serializer.XmlStream.TokenTyp...
+ const isStartElement Returns true if the last read token's type is Serializer.XmlStream.TokenTyp...
+ const new Creates a new stream for reading and writing data using stream.
+ override const read Reads the next token of the stream and returns its type. The stream context i...
+ const readElementText Returns the whole text contained in the current element. The behaviour must...
+ const readStartElement Reads the stream until the next Serializer.XmlStream.TokenType.StartElement t...
- final reader Internal reader context.
+ const setAutoClosing Enables the automatic closing of the markups writed to the stream. If enabl...
+ const setIndented Enables the indentation of the XML writed to the stream. If indented is t...
+ const skipCurrentElement Reads the stream until the end of the current element.
+ @ const toLocalName Returns the local name corresponding to the given qualifiedName.
+ const write Writes the XML described by data to the stream. The XML will be adapted to ...
+ const writeCData Writes a CDATA section to the output stream. Returns true on success; other...
+ const writeCharacters Writes a character section to the output stream. Returns true on success; o...
+ const writeComment Writes a comment section to the output stream. Returns true on success; oth...
+ const writeDtd Writes a DTD section to the output stream. Returns true on success; otherwi...
+ const writeEmptyElement Writes an opening element to the output stream. Returns true on success; ot...
+ const writeEmptyElementNS Writes an opening element to the output stream. Returns true on success; ot...
+ const writeEndDocument Ends the data writing to the output stream. Returns true on success; otherw...
+ const writeEndElement Writes a closing element to the output stream. If the element tag name does n...
+ const writeEndElementNS Writes a closing element to the output stream. If the element tag name does n...
+ const writeProcessingInstruction Writes a processing instruction to the output stream. Returns true on succe...
+ const writeStartDocument Begins the data writing to the output stream. Returns true on success; othe...
+ const writeStartElement Writes an opening element to the output stream. Returns true on success; ot...
+ const writeStartElementNS Writes an opening element to the output stream. Returns true on success; ot...
- final writer Internal writer context.

Serializer.XmlStream.Reader

This class provides a parser to convert an XML stream to tokens.

Members

Modifiers Member Description
+ class Attribute This class describe an attribute.
+ class NamespaceDeclaration This class describe a namespace declaration.
+ enum State This enum describe the current state of the parser. The values of this enum w...
+ class Tag This class describe an element tag.
+ final attributes
- final const eatWhiteSpace Returns the next non white space character.
- final elements
+ final encoding
- final const handleEndElement Handles a end element token.
- final const handleStartElement Handles a start element token.
- final const handleXmlAttribute Handles an XML attribute.
+ final hasCheckedStartDocument
- final internalAttributes
- final const namespaceForPrefix Returns the namespace URI for the given prefix.
+ final namespaceUri
- final namespaces
+ const new Creates a new parser on the stream given by stream.
+ const parse Reads the XML document and parses it until the next token. Returns true if ...
- final const parseAttrValue Returns the content of the next attribute value of the stream. An instance of...
- final const parseEscapeSequence Returns the value corresponding to the next escape sequence of the stream. An...
+ final qualifiedName
- final const resolveNamespaces Resolve all namepaces for the current element
+ final standalone
+ final state
- final stream Internal stream object.
+ final text
+ final tokenString
+ final type
+ final version

Serializer.XmlStream.Reader.Attribute

This class describe an attribute.

Members

Modifiers Member Description
+ final prefix
+ final qualifiedName
+ final value

Serializer.XmlStream.Reader.NamespaceDeclaration

This class describe a namespace declaration.

Members

Modifiers Member Description
+ final prefix
+ final uri

Serializer.XmlStream.Reader.Tag

This class describe an element tag.

Members

Modifiers Member Description
+ final namespaceIndex
+ final namespaceUri
+ final qualifiedName

Serializer.XmlStream.Writer

This class provides a writer to convert events to formated XML into a stream.

Members

Modifiers Member Description
+ final autoClose Internal automatic closing state.
- final elements Internal element stack.
- final indentationLevel Internal current indentation level.
+ final indented Internal indentation format state.
+ const new Creates a new writer on the stream given by stream.
+ const onCData Writes a CDATA section to the output stream. Returns true to continue input...
+ const onCharacters Writes a character section to the output stream. Returns true to continue i...
+ const onComment Writes a comment section to the output stream. Returns true to continue inp...
+ const onDtd Writes a DTD section to the output stream. Returns true to continue input s...
+ const onEndDocument Ends the data writing to the output stream. Returns true to continue input ...
+ const onEndElement Writes a closing element to the output stream. If the element tag name does n...
+ const onProcessingInstruction Writes a processing instruction to the output stream. Returns true to conti...
+ const onStartDocument Begins the data writing to the output stream. Returns true to continue inpu...
+ const onStartElement Writes an opening element to the output stream. Returns true to continue in...
- final openElement Internal element state.
- final stream Internal stream object.

Descriptions

Serializer.XmlAttribute.!=

def (const self, const other)

Returns false if other is the same attribute than self; otherwise returns true.

Serializer.XmlAttribute.==

def (const self, const other)

Returns true if other is the same attribute than self; otherwise returns false.

Serializer.XmlAttribute.getLocalName

def (const self)

Returns the local name of the attribute.

Serializer.XmlAttribute.getNamespaceUri

def (const self)

Returns the namespace URI of the attribute.

Serializer.XmlAttribute.getPrefix

def (const self)

Returns the prefix (namespace) of the attribute.

Serializer.XmlAttribute.getQualifiedName

def (const self)

Returns the qualified name of the attribute (prefix + name).

Serializer.XmlAttribute.getValue

def (const self)

Returns the value of the attribute.

Serializer.XmlAttribute.localName

''

Internal attribute name.

Serializer.XmlAttribute.namespaceUri

''

Internal attribute namespace URI.

Serializer.XmlAttribute.new

def (self)

Creates a new empty attribute.

def (self, qualifiedName, value)

Creates a new attribute with the given qualifiedName and value.

def (self, namespaceUri, qualifiedName, value)

Creates a new attribute with the given namespaceUri, qualifiedName and value.

Serializer.XmlAttribute.qualifiedName

''

Internal attribute qualified name.

Serializer.XmlAttribute.setValue

def (const self, const value)

Sets the value of the attribute to value.

Serializer.XmlAttribute.toString

def (const self)

Returns the string representation of the attribute.

Serializer.XmlAttribute.value

''

Internal attribute value.

Serializer.XmlAttributes.!=

def (const self, const other)

Returns true if other is not equal to this list of attributes; otherwise returns false.

Two lists are considered equal if they contain the same attributes in the same order.

Serializer.XmlAttributes.:=

def (self, other)

Copies the attributes contained in other into self then returns self.

Serializer.XmlAttributes.<<

def (self, attr)

Inserts attr at the end of the list.

Serializer.XmlAttributes.==

def (const self, const other)

Returns true if other is equal to this list of attributes; otherwise returns false.

Two lists are considered equal if they contain the same attributes in the same order.

Serializer.XmlAttributes.[]

def (const self, const index)

Returns the attribute at the given index.

Serializer.XmlAttributes.[]=

def (self, const qualifiedName, const value)

Sets the value of the first attribute with the given qualifiedName to value. If no element matched, a new attribute is created at the end of the list.

Serializer.XmlAttributes.attributes

[]

Internal attributes.

Serializer.XmlAttributes.clear

def (self)

Removes all the attributes of the list.

Serializer.XmlAttributes.contains

def (const self, const qualifiedName)

Returns true if the list contains an attribute with the given qualifiedName; otherwise returns false.

Serializer.XmlAttributes.containsNS

def (const self, const namespaceUri, const localName)

Returns true if the list contains an attribute with the givens namespaceUri and localName; otherwise returns false.

Serializer.XmlAttributes.get

def (const self, const qualifiedName)

Returns the first attribute with the given qualifiedName.

Serializer.XmlAttributes.getNS

def (const self, const namespaceUri, const localName)

Returns the first attribute with the givens namespaceUri and localName.

Serializer.XmlAttributes.in

def (const self, const qualifiedName)

Returns true if the list contains an attribute with the given qualifiedName; otherwise returns false.

def (const self)

Returns an iterator on each attribute of the list.

Serializer.XmlAttributes.indexOf

def (const self, const qualifiedName)

Returns the index position of the first attribute with the given qualifiedName. Returns none if no element matched.

Serializer.XmlAttributes.indexOfNS

def (const self, const namespaceUri, const localName)

Returns the index position of the first attribute with the givens namespaceUri and localName. Returns none if no element matched.

Serializer.XmlAttributes.insert

def (self, index, qualifiedName, value)

Creates a new attribute with the given qualifiedName and value at the given index.

Serializer.XmlAttributes.insertNS

def (self, index, namespaceUri, qualifiedName, value)

Creates a new attribute with the given namespaceUri, qualifiedName and value at the given index.

Serializer.XmlAttributes.isEmpty

def (const self)

Returns true if the list is empty; otherwise returns false.

Serializer.XmlAttributes.remove

def (self, const qualifiedName)

Removes the first attribute with the given qualifiedName.

Serializer.XmlAttributes.removeNS

def (self, const namespaceUri, const localName)

Removes the first attribute with the givens namespaceUri and localName.

Serializer.XmlAttributes.size

def (const self)

Returns the number of attributes in the list.

Serializer.XmlAttributes.toString

def (const self)

Returns the string representation of the attribute list.

Serializer.XmlAttributes.value

def (const self, const qualifiedName)

Returns the value of the first attribute with the given qualifiedName. Returns none if no element matched.

Serializer.XmlAttributes.valueNS

def (const self, const namespaceUri, const localName)

Returns the value of the first attribute with the givens namespaceUri and localName. Returns none if no element matched.

Serializer.XmlStream.<<

def (self, data)

Writes the content of data to the stream using the write function, then returns a reference to the stream.

Serializer.XmlStream.ReadElementTextBehaviour.ErrorOnUnexpectedElement

0

The children elements makes the stream raises an instance of Serializer.DocumentStream.InvalidDocument.

Serializer.XmlStream.ReadElementTextBehaviour.IncludeChildElements

1

The children elements are included in the element text.

Serializer.XmlStream.ReadElementTextBehaviour.SkipChildElements

2

The children elements are ignored.

Serializer.XmlStream.Reader.Attribute.prefix

''

Serializer.XmlStream.Reader.Attribute.qualifiedName

''

Serializer.XmlStream.Reader.Attribute.value

''

Serializer.XmlStream.Reader.NamespaceDeclaration.prefix

''

Serializer.XmlStream.Reader.NamespaceDeclaration.uri

''

Serializer.XmlStream.Reader.State.ReadAttributeName

15

Reading a tag attribute name (<... ... )

Serializer.XmlStream.Reader.State.ReadAttributeValue

16

Reading a tag attribute value (<... ...="..." )

Serializer.XmlStream.Reader.State.ReadCDataOpen

4

Reading a CDATA open token (<![CDATA[ )

Serializer.XmlStream.Reader.State.ReadCDataValue

5

Reading the content of a CDATA (<![CDATA[...]]> )

Serializer.XmlStream.Reader.State.ReadCharacters

3

Reading character inside a markup (<tag>...</tag> )

Serializer.XmlStream.Reader.State.ReadComment

2

Reading a comment (<!-- ... --> )

Serializer.XmlStream.Reader.State.ReadDtdOpen

6

Reading a DTD open token (<!DOCTYPE )

Serializer.XmlStream.Reader.State.ReadDtdValue

7

Reading the content of a DTD (<!DOCTYPE ... [ ... ]> )

Serializer.XmlStream.Reader.State.ReadNext

0

Waiting for a new element

Serializer.XmlStream.Reader.State.ReadOpen

1

Reading an opening token (< )

Serializer.XmlStream.Reader.State.ReadProcessingInstructionAttributeName

10

Reading a processing instruction attribute name (<?... ... )

Serializer.XmlStream.Reader.State.ReadProcessingInstructionAttributeValue

11

Reading a processing instruction attribute value (<?... ...="..." )

Serializer.XmlStream.Reader.State.ReadProcessingInstructionTagEnd

8

Reading a processing instruction close token (?> )

Serializer.XmlStream.Reader.State.ReadProcessingInstructionTagName

9

Reading a processing instruction tag name (<?... )

Serializer.XmlStream.Reader.State.ReadTagEnd

12

Reading a tag close token (</...> )

Serializer.XmlStream.Reader.State.ReadTagEndEmpty

13

Reading an empty tag close token (<.../> )

Serializer.XmlStream.Reader.State.ReadTagName

14

Reading a tag name (<... )

Serializer.XmlStream.Reader.Tag.namespaceIndex

none

Serializer.XmlStream.Reader.Tag.namespaceUri

''

Serializer.XmlStream.Reader.Tag.qualifiedName

''

Serializer.XmlStream.Reader.attributes

null

Serializer.XmlStream.Reader.eatWhiteSpace

def (self, c)

Returns the next non white space character.

Serializer.XmlStream.Reader.elements

[]

Serializer.XmlStream.Reader.encoding

'UTF-8'

Serializer.XmlStream.Reader.handleEndElement

def (self, isEmptyTag)

Handles a end element token.

Serializer.XmlStream.Reader.handleStartElement

def (self)

Handles a start element token.

Serializer.XmlStream.Reader.handleXmlAttribute

def (self, qualifiedName, value)

Handles an XML attribute.

Serializer.XmlStream.Reader.hasCheckedStartDocument

false

Serializer.XmlStream.Reader.internalAttributes

[]

Serializer.XmlStream.Reader.namespaceForPrefix

def (self, prefix)

Returns the namespace URI for the given prefix.

Serializer.XmlStream.Reader.namespaceUri

''

Serializer.XmlStream.Reader.namespaces

[]

Serializer.XmlStream.Reader.new

def (self, stream)

Creates a new parser on the stream given by stream.

Serializer.XmlStream.Reader.parse

def (self)

Reads the XML document and parses it until the next token. Returns true if the parsing is completed successfully; otherwise returns false, indicating that an event has not been correctly handled by the handler.

An instance of Serializer.DocumentStream.InvalidDocument is raised on error.

Serializer.XmlStream.Reader.parseAttrValue

def (self)

Returns the content of the next attribute value of the stream.

An instance of Serializer.DocumentStream.InvalidDocument is raised on error.

Serializer.XmlStream.Reader.parseEscapeSequence

def (self, c)

Returns the value corresponding to the next escape sequence of the stream.

An instance of Serializer.DocumentStream.InvalidDocument is raised on error.

Serializer.XmlStream.Reader.qualifiedName

''

Serializer.XmlStream.Reader.resolveNamespaces

def (self)

Resolve all namepaces for the current element

Serializer.XmlStream.Reader.standalone

false

Serializer.XmlStream.Reader.state

null

Serializer.XmlStream.Reader.stream

null

Internal stream object.

Serializer.XmlStream.Reader.text

''

Serializer.XmlStream.Reader.tokenString

''

Serializer.XmlStream.Reader.type

null

Serializer.XmlStream.Reader.version

'1.0'

Serializer.XmlStream.TokenType.CDATA

8

Serializer.XmlStream.TokenType.Characters

6

Serializer.XmlStream.TokenType.Comment

7

Serializer.XmlStream.TokenType.DTD

9

Serializer.XmlStream.TokenType.EndDocument

3

Serializer.XmlStream.TokenType.EndElement

5

Serializer.XmlStream.TokenType.Invalid

0

Serializer.XmlStream.TokenType.ProcessingInstruction

1

Serializer.XmlStream.TokenType.StartDocument

2

Serializer.XmlStream.TokenType.StartElement

4

Serializer.XmlStream.Writer.autoClose

false

Internal automatic closing state.

Serializer.XmlStream.Writer.elements

[]

Internal element stack.

Serializer.XmlStream.Writer.indentationLevel

0

Internal current indentation level.

Serializer.XmlStream.Writer.indented

false

Internal indentation format state.

Serializer.XmlStream.Writer.new

def (self, stream)

Creates a new writer on the stream given by stream.

Serializer.XmlStream.Writer.onCData

def (self, content)

Writes a CDATA section to the output stream. Returns true to continue input stream parsing.

Serializer.XmlStream.Writer.onCharacters

def (self, content)

Writes a character section to the output stream. Returns true to continue input stream parsing.

Serializer.XmlStream.Writer.onComment

def (self, content)

Writes a comment section to the output stream. Returns true to continue input stream parsing.

Serializer.XmlStream.Writer.onDtd

def (self, content)

Writes a DTD section to the output stream. Returns true to continue input stream parsing.

Serializer.XmlStream.Writer.onEndDocument

def (self)

Ends the data writing to the output stream. Returns true to continue input stream parsing.

Serializer.XmlStream.Writer.onEndElement

def (self, namespaceUri, localName, qualifiedName)

Writes a closing element to the output stream. If the element tag name does not match the previously opened element, the function returns false to interput the parsing; otherwise returns true.

def (self)

Writes a closing element to the output stream matching the last opened element. If no element is open, the function returns false to interput the parsing; otherwise returns true.

Serializer.XmlStream.Writer.onProcessingInstruction

def (self, localName, attributes)

Writes a processing instruction to the output stream. Returns true to continue input stream parsing.

Serializer.XmlStream.Writer.onStartDocument

def (self)

Begins the data writing to the output stream. Returns true to continue input stream parsing.

Serializer.XmlStream.Writer.onStartElement

def (self, namespaceUri, localName, qualifiedName, attributes)

Writes an opening element to the output stream. Returns true to continue input stream parsing.

Serializer.XmlStream.Writer.openElement

false

Internal element state.

Serializer.XmlStream.Writer.stream

null

Internal stream object.

Serializer.XmlStream.escapeString

def (str)

Returns the content of str with special characters escaped to be inserted in an XML document.

Serializer.XmlStream.getAttributes

def (const self)

Returns current element's attributs as instances of Serializer.XmlAttributes.

Serializer.XmlStream.getDocumentEncoding

def (const self)

Returns the name of the encoding used by the document.

Serializer.XmlStream.getDocumentVersion

def (const self)

Returns the version of the XML standard used by the document.

Serializer.XmlStream.getLocalName

def (const self)

Returns the name of the current element.

Serializer.XmlStream.getNamespaceUri

def (const self)

Returns the namespace URI of the current element.

Serializer.XmlStream.getPrefix

def (const self)

Returns the prefix (namespace) of the current element.

Serializer.XmlStream.getProcessingInstructionData

def (const self)

Returns the current processing instruction's data as instances of Serializer.XmlAttributes.

Serializer.XmlStream.getProcessingInstructionTarget

def (const self)

Returns the current processing instructions's target.

Serializer.XmlStream.getQualifiedName

def (const self)

Returns the qualified name of the current element (prefix + name).

Serializer.XmlStream.getText

def (const self)

Returns the current texte.

Serializer.XmlStream.getTokenString

def (const self)

Returns the last read token's text as a string.

Serializer.XmlStream.getTokenType

def (const self)

Returns the last read token's type as a value of Serializer.XmlSaxStream.TokenType.

Serializer.XmlStream.isAutoClosing

def (const self)

Returns true if the stream automaticaly close the markups when writing; otherwise returns false.

Serializer.XmlStream.isCDATA

def (const self)

Returns true if the last read token's type is Serializer.XmlStream.TokenType.CDATA; otherwise returns false.

Serializer.XmlStream.isCharacters

def (const self)

Returns true if the last read token's type is Serializer.XmlStream.TokenType.Characters; otherwise returns false.

Serializer.XmlStream.isComment

def (const self)

Returns true if the last read token's type is Serializer.XmlStream.TokenType.Comment; otherwise returns false.

Serializer.XmlStream.isDTD

def (const self)

Returns true if the last read token's type is Serializer.XmlStream.TokenType.DTD; otherwise returns false.

Serializer.XmlStream.isEndDocument

def (const self)

Returns true if the last read token's type is Serializer.XmlStream.TokenType.EndDocument; otherwise returns false.

Serializer.XmlStream.isEndElement

def (const self)

Returns true if the last read token's type is Serializer.XmlStream.TokenType.EndElement; otherwise returns false.

Serializer.XmlStream.isIndented

def (const self)

Returns true if the stream indent the XML when writing; otherwise returns false.

Serializer.XmlStream.isProcessingInstruction

def (const self)

Returns true if the last read token's type is Serializer.XmlStream.TokenType.ProcessingInstruction; otherwise returns false.

Serializer.XmlStream.isStandaloneDocument

def (const self)

Returns true if the standalone attribute of the document is set; otherwise returns false.

Serializer.XmlStream.isStartDocument

def (const self)

Returns true if the last read token's type is Serializer.XmlStream.TokenType.StartDocument; otherwise returns false.

Serializer.XmlStream.isStartElement

def (const self)

Returns true if the last read token's type is Serializer.XmlStream.TokenType.StartElement; otherwise returns false.

Serializer.XmlStream.new

def (self, stream)

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

Serializer.XmlStream.read

def (self)

Reads the next token of the stream and returns its type. The stream context is the updated with the token informations.

Serializer.XmlStream.readElementText

def (self, behaviour = Serializer.XmlStream.ReadElementTextBehaviour.ErrorOnUnexpectedElement)

Returns the whole text contained in the current element. The behaviour must be a value from ReadElementTextBehaviour that describe the behaviour of this method when a child element is encountred. If the stream is not on an Serializer.XmlStream.TokenType.StartElement token, none is returned.

Serializer.XmlStream.readStartElement

def (self)

Reads the stream until the next Serializer.XmlStream.TokenType.StartElement token. Returns true if a token was found; otherwise returns false.

Serializer.XmlStream.reader

null

Internal reader context.

Serializer.XmlStream.setAutoClosing

def (self, enabled)

Enables the automatic closing of the markups writed to the stream. If enabled is true, the markups will be automaticaly closed; otherwise the unclosed markups will be keeped to be slosed later.

Closed markups example:

<?xml version="1.0" encoding="UTF-8"?>
<document attr="value">
    <tag attr="value"/>
</document>

Unclosed markups example:

<?xml version="1.0" encoding="UTF-8"?>
<document attr="value">
    <tag attr="value"/>

By default, the markups are not closed.

Serializer.XmlStream.setIndented

def (self, enabled)

Enables the indentation of the XML writed to the stream. If indented is true, the XML will be indented; otherwise the XML will be compact.

Indented example:

<?xml version="1.0" encoding="UTF-8"?>
<document attr="value">
    <tag attr="value"/>
</document>

Compact example:

<?xml version="1.0" encoding="UTF-8"?><document attr="value"><tag attr="value"/></document>

By default, the data is not indented.

Serializer.XmlStream.skipCurrentElement

def (self)

Reads the stream until the end of the current element.

Serializer.XmlStream.toLocalName

def (qualifiedName)

Returns the local name corresponding to the given qualifiedName.

Serializer.XmlStream.write

def (self, data)

Writes the XML described by data to the stream. The XML will be adapted to match the configuration sets by setIndented and setAutoClosing. Returns true if all the data have been correctly writed; otherwise returns false. If the content of the data is not a valid XML, an instance of Serializer.DocumentStream.InvalidDocument is raised.

Serializer.XmlStream.writeCData

def (self, content)

Writes a CDATA section to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeCharacters

def (self, content)

Writes a character section to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeComment

def (self, content)

Writes a comment section to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeDtd

def (self, content)

Writes a DTD section to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeEmptyElement

def (self, qualifiedName, attributes = Serializer.XmlAttributes ())

Writes an opening element to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeEmptyElementNS

def (self, namespaceUri, localName, qualifiedName, attributes = Serializer.XmlAttributes ())

Writes an opening element to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeEndDocument

def (self)

Ends the data writing to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeEndElement

def (self, qualifiedName)

Writes a closing element to the output stream. If the element tag name does not match the previously opened element, the function returns false; otherwise returns true.

def (self)

Writes a closing element to the output stream.

Serializer.XmlStream.writeEndElementNS

def (self, namespaceUri, localName, qualifiedName)

Writes a closing element to the output stream. If the element tag name does not match the previously opened element, the function returns false; otherwise returns true.

Serializer.XmlStream.writeProcessingInstruction

def (self, localName, attributes)

Writes a processing instruction to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeStartDocument

def (self)

Begins the data writing to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeStartElement

def (self, qualifiedName, attributes = Serializer.XmlAttributes ())

Writes an opening element to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writeStartElementNS

def (self, namespaceUri, localName, qualifiedName, attributes = Serializer.XmlAttributes ())

Writes an opening element to the output stream. Returns true on success; otherwise returns false.

Serializer.XmlStream.writer

null

Internal writer context.

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