RAVE
Lib.BaltradMessageXML.BltXML Class Reference

Base element. More...

Inheritance diagram for Lib.BaltradMessageXML.BltXML:
Lib.rave_pgf_registry.PGF_Registry

Public Member Functions

 __init__ (self, tag=PGF_TAG, encoding=UTF8, filename=None, msg=None)
 
 setencoding (self, encoding)
 Sets encoding attribute of this instance.
 
 tostring (self, doindent=True)
 Formats the object and its contents to an XML string.
 
 fromstring (self, msg)
 Formats the object from an XML message string.
 
 indent (self, elem=None, level=0)
 Indents self.
 
 save (self, filename=None, doindent=True)
 Writes an XML message to file.
 
 read (self, filename=None)
 Reads a message from XML file.
 
 append (self, el)
 
 find (self, name)
 
 remove (self, element)
 
 set (self, key, value)
 
 subelement (self, key)
 
 getelement (self)
 

Public Attributes

 tag = tag
 
 encoding = encoding
 
 filename = filename
 
 element = BltXMLElement(tag)
 
str header = """<?xml version="1.0" encoding="%s"?>""" % encoding
 

Detailed Description

Base element.

Constructor & Destructor Documentation

◆ __init__()

Lib.BaltradMessageXML.BltXML.__init__ ( self,
tag = PGF_TAG,
encoding = UTF8,
filename = None,
msg = None )

Member Function Documentation

◆ fromstring()

Lib.BaltradMessageXML.BltXML.fromstring ( self,
msg )

Formats the object from an XML message string.

Parameters
msgstring XML representation of the message.

◆ indent()

Lib.BaltradMessageXML.BltXML.indent ( self,
elem = None,
level = 0 )

Indents self.

◆ read()

Lib.BaltradMessageXML.BltXML.read ( self,
filename = None )

Reads a message from XML file.

Parameters
filenamestring of the XML file to read.

◆ save()

Lib.BaltradMessageXML.BltXML.save ( self,
filename = None,
doindent = True )

Writes an XML message to file.

Parameters
filenamestring of the file to write.

◆ setencoding()

Lib.BaltradMessageXML.BltXML.setencoding ( self,
encoding )

Sets encoding attribute of this instance.

Parameters
encodingstring, the character encoding used, should probably be UTF-8.

◆ tostring()

Lib.BaltradMessageXML.BltXML.tostring ( self,
doindent = True )

Formats the object and its contents to an XML string.

Suggestion: add line breaks and indentation.

Returns
string XML representation of this message.

The documentation for this class was generated from the following file: