# xmlWriter

xmlWriter.py – Simple XML authoring class

class fontTools.misc.xmlWriter.XMLWriter(fileOrPath, indentwhite=' ', idlefunc=None, encoding='utf_8', newlinestr='\n')

  Bases: `object`

  close()
  write(string, indent=True)

    Writes text.

  writecdata(string)

    Writes text in a CDATA section.

  write8bit(data, strip=False)

    Writes a bytes() sequence into the XML, escaping non-ASCII bytes. When this is read in xmlReader, the original bytes can be recovered by encoding to ‘latin-1’.

  write_noindent(string)

    Writes text without indentation.

  newline()
  comment(data)
  simpletag(_TAG_, *args, **kwargs)
  begintag(_TAG_, *args, **kwargs)
  endtag(_TAG_)
  dumphex(data)
  indent()
  dedent()
  stringifyattrs(*args, **kwargs)

fontTools.misc.xmlWriter.escape(data)

fontTools.misc.xmlWriter.escapeattr(data)

fontTools.misc.xmlWriter.escape8bit(data)

  Input is Unicode string.

fontTools.misc.xmlWriter.hexStr(s)