Next / Previous / Contents / Shipman's homepage

29. Sox._emptyTag(): Write an empty XML tag

This method is nearly identical to Section 28, “Sox._startTag(): Write a start tag”, except that it appends a slash “/” just inside the closing “>”.

sox.py
# - - -   S o x . _ e m p t y T a g

    def _emptyTag(self, uTag, attribs):
        '''Write an empty XML tag.
        '''
        #-- 1
        self.outFile.write("<%s%s/>" %
            (uTag.encode('utf-8'), self._buildAttrs(attribs)))