def _XMLDumpStartTag (self, tag, attrs, indent,
                        primitive_dump=False, none_dump=False,
                        was_array_typecode=None) :
      if tag is self.NULLKey_ : return

      if self.options_ & XML_DUMP_PRETTY :
          self.os_.write( ' '*indent )
      self.os_.write('<')
      self._XMLDumpName(tag)
      
      # Attributes  key1="something" key2="somethingelse"
      len_attrs = len(attrs)
      if len_attrs >= 1 : self.os_.write(" ")
      where = 0
      for key, val in sorted(attrs.iteritems()) :
          # String as is
          attr_name = str(key)
          if (len(attr_name)>0 and attr_name[0]==self.prependChar_ and
              ((self.options_ & XML_DUMP_PREPEND_KEYS_AS_TAGS)==0) ) :
              attr_name = attr_name[1:] # strip _
          
          attr_val = str(val)
      
          #os_ << attr_name << "=" << attr_val;
          self._XMLDumpName(attr_name)
          self.os_.write("=\"" + self._XMLContentFilter(attr_val, was_array_typecode) + "\"") # TODO: handle '

          where += 1
          if (where!=len_attrs) : # last one, no extra space
              self.os_.write(" ") 
      
      if none_dump: self.os_.write("/")
      self.os_.write(">")
      if ((self.options_ & XML_DUMP_PRETTY)!=0) and (not primitive_dump or none_dump) :
          self.os_.write("\n")



  # Dump the end tag, with attention to output options and formatting
dataset/ETHPy150Open redhat-imaging/imagefactory/imgfac/picklingtools/xmldumper.py/XMLDumper._XMLDumpStartTag/original