Last page update: November 23, 2011
Classes:
External methods:
Complete reference:
The class that handles the conversion from the XML format to the Bag class
TODO
| Parameters: |
|
|---|
TODO
| Parameters: |
|
|---|
The class that handles the conversion from the Bag class to the XML format
Return an XML block version of the Bag.
The XML block version of the Bag uses XML attributes for an efficient representation of types: If the element-leaf is a simple string, there are no type attributes in the corresponding XML nodes otherwise a ‘T’ attribute is set to the node and the value of ‘T’ changes in function of the type (value of ‘T’ is ‘B’ for boolean, ‘L’ for integer, ‘R’ for float, ‘D’ for date, ‘H’ for time).
>>> mybag=Bag()
>>> mybag['aa.bb']=4567
>>> mybag['aa.cc']='test'
>>> mybag.toXmlBlock()
['<aa>', u'<cc>test</cc>', u'<bb T="L">4567</bb>', '</aa>']
Return a complete standard XML version of the Bag, including the encoding tag <?xml version='1.0' encoding='UTF-8'?>; the Bag’s content is hierarchically represented as an XML block sub-element of the <GenRoBag> node.
Is also possible to write the result on a file, passing the path of the file as the filename parameter.
| Parameters: |
|
|---|
>>> mybag = Bag()
>>> mybag['aa.bb'] = 4567
>>> mybag.toXml()
'<?xml version='1.0' encoding='iso-8859-15'?><GenRoBag><aa><bb T="L">4567</bb></aa></GenRoBag>'
TODO Return the XML tag that represent self BagNode
| Parameters: |
|
|---|