![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|


Public Member Functions | |
| __init__ (self, *children, **attributes) | |
| __repr__ (self) | |
| __str__ (self) | |
| set (self, key, value) | |
| __setitem__ (self, key, value) | |
| is_full (self) | |
| close (self) | |
| append (self, element) | |
| extend (self, elements) | |
| pop (self, index=-1) | |
| in_block (self) | |
| indent_xml (self, space=' ', level=0) | |
| unindent_xml (self) | |
| toxml (self, encoding=None) | |
Static Public Member Functions | |
| a_str (v) | |
Public Attributes | |
| text | |
Static Public Attributes | |
| nchildren = None | |
| parent = None | |
Base class for MathML elements.
| docutils.utils.math.mathml_elements.MathElement.__init__ | ( | self, | |
| * | children, | ||
| ** | attributes | ||
| ) |
Set up node with `children` and `attributes`. Attribute names are normalised to lowercase. You may use "CLASS" to set a "class" attribute. Attribute values are converted to strings (with True -> "true" and False -> "false"). >>> math(CLASS='test', level=3, split=True) math(class='test', level='3', split='true') >>> math(CLASS='test', level=3, split=True).toxml() '<math class="test" level="3" split="true"></math>'
Reimplemented in docutils.utils.math.mathml_elements.MathSchema, and docutils.utils.math.mathml_elements.MathToken.
| docutils.utils.math.mathml_elements.MathElement.__repr__ | ( | self | ) |
Return full string representation.
| docutils.utils.math.mathml_elements.MathElement.__str__ | ( | self | ) |
Return concise, informal string representation.
| docutils.utils.math.mathml_elements.MathElement.append | ( | self, | |
| element | |||
| ) |
Append `element` and return new "current node" (insertion point). Append as child element and set the internal `parent` attribute. If self is already full, raise TypeError. If self is full after appending, call `self.close()` (returns first non-full anchestor or None) else return `self`.
Reimplemented in docutils.utils.math.mathml_elements.MathSchema.
| docutils.utils.math.mathml_elements.MathElement.close | ( | self | ) |
Close element and return first non-full anchestor or None.
Reimplemented in docutils.utils.math.mathml_elements.mrow.
| docutils.utils.math.mathml_elements.MathElement.extend | ( | self, | |
| elements | |||
| ) |
Sequentially append `elements`. Return new "current node". Raise TypeError if overfull.
| docutils.utils.math.mathml_elements.MathElement.in_block | ( | self | ) |
Return True, if `self` or an ancestor has ``display='block'``. Used to find out whether we are in inline vs. displayed maths.
| docutils.utils.math.mathml_elements.MathElement.indent_xml | ( | self, | |
space = ' ', |
|||
level = 0 |
|||
| ) |
Format XML output with indents. Use with care: Formatting whitespace is permanently added to the `text` and `tail` attributes of `self` and anchestors!
| docutils.utils.math.mathml_elements.MathElement.is_full | ( | self | ) |
Return boolean indicating whether children may be appended.
| docutils.utils.math.mathml_elements.MathElement.toxml | ( | self, | |
encoding = None |
|||
| ) |
Return an XML representation of the element. By default, the return value is a `str` instance. With an explicit `encoding` argument, the result is a `bytes` instance in the specified encoding. The XML default encoding is UTF-8, any other encoding must be specified in an XML document header. Name and encoding handling match `xml.dom.minidom.Node.toxml()` while `etree.Element.tostring()` returns `bytes` by default.
| docutils.utils.math.mathml_elements.MathElement.unindent_xml | ( | self | ) |
Strip whitespace at the end of `text` and `tail` attributes... to revert changes made by the `indent_xml()` method. Use with care, trailing whitespace from the original may be lost.