XML Functions

Although Myokit’s mmt format is not an XML format, Myokit interacts with XML formats in various ways. The myokit.mxml module provides XML tools for common tasks. This module is imported as part of the main myokit package.

Etree helpers

myokit.mxml.split(tag)

Splits a tag (as used in elementtree) into a namespace and an element name part.

Converting html to ascii

myokit.mxml.html2ascii(html, width=79, indent=' ')

Flattens HTML and attempts to create readable ASCII code.

The output will be text-wrapped after width characters. Each new level of nesting will be indented with the text given as indent.