Skip to content

serializers

Add x/html serialization to Elementree.

Taken from ElementTree 1.3 preview with slight modifications

Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved.

fredrik@pythonware.com http://www.pythonware.com


The ElementTree toolkit is

Copyright (c) 1999-2007 by Fredrik Lundh

By obtaining, using, and/or copying this software and/or its associated documentation, you agree that you have read, understood, and will comply with the following terms and conditions:

Permission to use, copy, modify, and distribute this software and its associated documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies, and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Secret Labs AB or the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.

SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Attributes

ElementTree = util.etree.ElementTree module-attribute

QName = util.etree.QName module-attribute

Comment = util.etree.test_comment module-attribute

PI = util.etree.PI module-attribute

ProcessingInstruction = util.etree.ProcessingInstruction module-attribute

HTML_EMPTY = set(HTML_EMPTY) module-attribute

Functions

to_html_string(element)

Source code in pyrevitlib/pyrevit/coreutils/markdown/serializers.py
def to_html_string(element):
    return _write_html(ElementTree(element).getroot(), format="html")

to_xhtml_string(element)

Source code in pyrevitlib/pyrevit/coreutils/markdown/serializers.py
def to_xhtml_string(element):
    return _write_html(ElementTree(element).getroot(), format="xhtml")