(self, header, data, sort=True)
Adds string element to the xml.
Adds string element to the xml.
Adds string element to the xml .
def string(self, header, data, sort=True):
        '''
        Adds string element to the xml.
        '''
        if isinstance(data, (list, tuple, set)):
            self.lister(header, data, sort)
            return

        messagesElem = self._getRootChild(MESSAGES_ELEM_NAME)
        if (not(messagesElem)):
            messagesElem = self.__doc.createElement(MESSAGES_ELEM_NAME)
            self._addToRoot(messagesElem)

        if data:
            data = self._formatString(data)
        else:
            data = ""

        elem = self.__doc.createElement(MESSAGE_ELEM)
        elem.setAttributeNode(self._createAttribute(TYPE_ATTR, header))
        elem.appendChild(self._createTextNode(data))
        messagesElem.appendChild(elem)
def string ( self , header , data , sort = True ) : if isinstance ( data , ( list , tuple , set ) ) : self . lister ( header , data , sort ) return messagesElem = self . _getRootChild ( MESSAGES_ELEM_NAME ) if ( not ( messagesElem ) ) : messagesElem = self . __doc . createElement ( MESSAGES_ELEM_NAME ) self . _addToRoot ( messagesElem ) if data : data = self . _formatString ( data ) else : data = "" elem = self . __doc . createElement ( MESSAGE_ELEM ) elem . setAttributeNode ( self . _createAttribute ( TYPE_ATTR , header ) ) elem . appendChild ( self . _createTextNode ( data ) ) messagesElem . appendChild ( elem )