sbswriter module
Module sbswriter provides the class SBSWriter which allows the serialization of a SBSDocument into a .sbs file.
- All derived
SBSObjecthave a write function with the same signature than on the base classSBSObject: common_interface.SBSObject.write()
- class sbswriter.SBSWriter(aXmlRootNode, aPackagePath, aContext)
Bases:
objectClass used to provide useful functions when writing a .sbs (=xml) file from a SBSDocument
- setXmlElementAttribValue(aXmlElementParent, aAttribute, aAttribName)
setXmlElementVAttribValue(aXmlElementParent, aAttribute, aChildName) Write the given attribute as a child of the given XmlParent, using the format <childname v=””/> <xmlNode attribName=attribute></xmlNode>
- setXmlElementVAttribValue(aXmlElementParent, aAttribute, aChildName)
Write the given attribute as a child of the given XmlParent, using the format <childname v=””/> <xmlNode><childname v=””/></xmlNode>
- setXmlFilePathValue(aXmlElementParent, aAttribute, aChildName)
Convert attribute path before as a absolute path. Write the given attribute as a child of the given XmlParent, using the format <childname v=””/> <xmlNode><childname v=””/></xmlNode>
- writeAllSBSNodesIn(aXmlNode, aObject, aTagName)
Write the given list of SBSObject using its proper writing method, and its XML description directly to the given XmlNode <xmlNode><tagname>…</tagname><tagname>…</tagname>…</xmlNode>
- writeListOfSBSNode(aXmlNode, aSBSObject, aTagName, aChildTagName)
Write the given list of SBSObject using their proper writing method, and add its hierarchical XML description to the given XmlNode <xmlNode><tagname><childtagname>…</childtagname><childtagname>…</childtagname>… </tagname></xmlNode>
- writeOnDisk(aFileAbsPath, aFormatDoc=False, aIncludeXMLHeader=True)
Write on disk the XmlRootNode, with the appropriate header, at the given path
- writeSBSNode(aXmlNode, aSBSObject, aTagName)
Write the given SBSObject using its proper writing method, and add its XML description to the given XmlNode <xmlNode><tagname>…</tagname></xmlnode>