html
– HTML namespace
An XIST namespace that contains definitions for all the elements in HTML5 as well as some (deprecated) elements that were in use in previous HTML versions.
This namespace also supports the elements and attributes from the microdata specification.
For all deprecated elements and attributes the class attribute deprecated
is set to True
.
The function astext()
can be used to convert a HTML XIST tree into plain
text.
- class ll.xist.ns.html.DocTypeHTML40transitional[source]
Bases:
DocType
document type for HTML 4.0 transitional
- class ll.xist.ns.html.DocTypeHTML401transitional[source]
Bases:
DocType
document type for HTML 4.01 transitional
- class ll.xist.ns.html.DocTypeXHTML10strict[source]
Bases:
DocType
document type for XHTML 1.0 strict
- class ll.xist.ns.html.DocTypeXHTML10transitional[source]
Bases:
DocType
document type for XHTML 1.0 transitional
- class ll.xist.ns.html.GlobalAttrs[source]
Bases:
Attrs
Attributes that are common to and may be specified on all HTML elements
- class accesskey[source]
Bases:
TextAttr
This attribute’s value is used by the user agent as a guide for creating a keyboard shortcut that activates or focuses the element.
If specified, the value must be an ordered set of unique space-separated tokens that are case-sensitive, each of which must be exactly one Unicode code point in length.
- class class_[source]
Bases:
TextAttr
This attribute, if specified, must have a value that is a set of space-separated tokens representing the various classes that the element belongs to.
Bases:
TextAttr
The element’s context menu. The value must be the ID of a menu element in the DOM.
- class dropzone[source]
Bases:
TextAttr
Specifies which types of objects are allowed to be dropped on the element and how they are handled.
Bases:
BoolAttr
When specified, indicates that the element is not yet, or is no longer, directly relevant to the page’s current state.
User agents should not render elements that have the hidden attribute specified.
- class lang[source]
Bases:
TextAttr
Specifies the primary language for the element’s contents and for any of the element’s attributes that contain text.
- class spellcheck[source]
Bases:
TextAttr
Specifies whether the user agent should indicate spelling and/or grammar errors in content of the element.
- class tabindex[source]
Bases:
IntAttr
Specifies whether an element is supposed to be focusable and what is to be the relative order of the element for the purposes of sequential focus navigation.
- class title[source]
Bases:
TextAttr
Advisory information for the element, such as would be appropriate for a tooltip.
- class translate[source]
Bases:
TextAttr
An enumerated attribute that is used to specify whether an element’s attribute values and the values of its text node children are to be translated when the page is localized, or whether to leave them unchanged.
- class role[source]
Bases:
TextAttr
If specified, must have a value that is a set of space-separated tokens representing the various WAI-ARIA roles that the element belongs to.
Bases:
TextAttr
Event handler
- class itemscope[source]
Bases:
BoolAttr
Microdata attribute: Creates a new item, a group of name-value pairs.
- class ll.xist.ns.html.base[source]
Bases:
Element
Allows authors to specify the document base URL for the purposes of resolving relative URLs, and the name of the default browsing context for the purposes of following hyperlinks.
- class ll.xist.ns.html.link[source]
Bases:
Element
Allows authors to link their document to other resources.
- class ll.xist.ns.html.meta[source]
Bases:
Element
Various kinds of metadata that cannot be expressed using the
title
,base
,link
,style
, andscript
elements.
- class ll.xist.ns.html.style[source]
Bases:
Element
Allows authors to embed style information in their documents.
- class ll.xist.ns.html.script[source]
Bases:
Element
Allows authors to include dynamic script and data blocks in their documents.
- class ll.xist.ns.html.noscript[source]
Bases:
Element
Represents nothing if scripting is enabled, and represents its children if scripting is disabled.
- class ll.xist.ns.html.article[source]
Bases:
Element
A self-contained composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication.
This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.
- class ll.xist.ns.html.section[source]
Bases:
Element
A generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading.
Bases:
Element
A section of a page that links to other pages or to parts within the page: a section with navigation links.
- class ll.xist.ns.html.aside[source]
Bases:
Element
A section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. Such sections are often represented as sidebars in printed typography.
- class ll.xist.ns.html.h[source]
Bases:
Element
Base class of
h1
,h2
,h3
,h4
,h5
andh6
, which represent headings for their sections.
- class ll.xist.ns.html.hgroup[source]
Bases:
Element
The heading of a section. The element is used to group a set of
h1
–h6
elements when the heading has multiple levels, such as subheadings, alternative titles, or taglines.
Bases:
Element
A footer for its nearest ancestor sectioning content or sectioning root element. A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like.
- class ll.xist.ns.html.address[source]
Bases:
Element
The contact information for its nearest
article
orbody
element ancestor.
- class ll.xist.ns.html.hr[source]
Bases:
Element
A paragraph-level thematic break, e.g. a scene change in a story, or a transition to another topic within a section of a reference book.
- class ll.xist.ns.html.pre[source]
Bases:
Element
A block of preformatted text, in which structure is represented by typographic conventions rather than by elements.
- class ll.xist.ns.html.blockquote[source]
Bases:
Element
A section that is quoted from another source.
- class ll.xist.ns.html.ol[source]
Bases:
Element
A list of items, where the items have been intentionally ordered, such that changing the order would change the meaning of the document.
- class ll.xist.ns.html.ul[source]
Bases:
Element
A list of items, where the order of the items is not important — that is, where changing the order would not materially change the meaning of the document.
- class ll.xist.ns.html.dl[source]
Bases:
Element
An association list consisting of zero or more name-value groups (a description list). Each group must consist of one or more names (
dt
elements) followed by one or more values (dd
elements). Within a single dl element, there should not be more than onedt
element for each name.Name-value groups may be terms and definitions, metadata topics and values, questions and answers, or any other groups of name-value data.
- class ll.xist.ns.html.dt[source]
Bases:
Element
The term, or name, part of a term-description group in a description list (
dl
element).
- class ll.xist.ns.html.dd[source]
Bases:
Element
The description, definition, or value, part of a term-description group in a description list (
dl
element).
- class ll.xist.ns.html.figure[source]
Bases:
Element
Some flow content, optionally with a caption, that is self-contained and is typically referenced as a single unit from the main flow of the document.
The element can thus be used to annotate illustrations, diagrams, photos, code listings, etc, that are referred to from the main content of the document, but that could, without affecting the flow of the document, be moved away from that primary content, e.g. to the side of the page, to dedicated pages, or to an appendix.
Bases:
Element
A caption or legend for the rest of the contents of the
figcaption
element’s parentfigure
element, if any.
- class ll.xist.ns.html.div[source]
Bases:
Element
The
div
element has no special meaning at all. It represents its children. It can be used with theclass
,lang
, andtitle
attributes to mark up semantics common to a group of consecutive elements.
- class ll.xist.ns.html.a[source]
Bases:
Element
If the
a
element has anhref
attribute, then it represents a hyperlink (a hypertext anchor) labeled by its contents.If the
a
element has nohref
attribute, then the element represents a placeholder for where a link might otherwise have been placed, if it had been relevant, consisting of just the element’s contents.
- class ll.xist.ns.html.s[source]
Bases:
Element
Contents that are no longer accurate or no longer relevant.
- class ll.xist.ns.html.cite[source]
Bases:
Element
The title of a work (e.g. a book, a paper, an essay, a poem, a score, a song, a script, a film, a TV show, a game, a sculpture, a painting, a theatre production, a play, an opera, a musical, an exhibition, a legal case report, etc). This can be a work that is being quoted or referenced in detail (i.e. a citation), or it can just be a work that is mentioned in passing.
- class ll.xist.ns.html.dfn[source]
Bases:
Element
The defining instance of a term. The paragraph, description list group, or section that is the nearest ancestor of the
dfn
element must also contain the definition(s) for the term given by thedfn
element.
- class ll.xist.ns.html.abbr[source]
Bases:
Element
An abbreviation or acronym, optionally with its expansion. The
title
attribute may be used to provide an expansion of the abbreviation. The attribute, if specified, must contain an expansion of the abbreviation, and nothing else.
- class ll.xist.ns.html.time[source]
Bases:
Element
Represents its contents, along with a machine-readable form of those contents in the
datetime
attribute.
- class ll.xist.ns.html.code[source]
Bases:
Element
A fragment of computer code. This could be an XML element name, a filename, a computer program, or any other string that a computer would recognize.
- class ll.xist.ns.html.var[source]
Bases:
Element
A variable. This could be an actual variable in a mathematical expression or programming context, an identifier representing a constant, a symbol identifying a physical quantity, a function parameter, or just be a term used as a placeholder in prose.
- class ll.xist.ns.html.samp[source]
Bases:
Element
A (sample) output from a program or computing system.
- class ll.xist.ns.html.kbd[source]
Bases:
Element
User input (typically keyboard input, although it may also be used to represent other input, such as voice commands).
- class ll.xist.ns.html.i[source]
Bases:
Element
A span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase or short span of transliterated prose from another language, a thought, or a ship name in Western texts.
- class ll.xist.ns.html.b[source]
Bases:
Element
A span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede.
- class ll.xist.ns.html.u[source]
Bases:
Element
A span of text with an unarticulated, though explicitly rendered, non-textual annotation, such as labeling the text as being a proper name in Chinese text (a Chinese proper name mark), or labeling the text as being misspelt.
- class ll.xist.ns.html.mark[source]
Bases:
Element
A run of text in one document marked or highlighted for reference purposes, due to its relevance in another context. When used in a quotation or other block of text referred to from the prose, it indicates a highlight that was not originally present but which has been added to bring the reader’s attention to a part of the text that might not have been considered important by the original author when the block was originally written, but which is now under previously unexpected scrutiny. When used in the main prose of a document, it indicates a part of the document that has been highlighted due to its likely relevance to the user’s current activity.
- class ll.xist.ns.html.ruby[source]
Bases:
Element
Allows one or more spans of phrasing content to be marked with ruby annotations. Ruby annotations are short runs of text presented alongside base text, primarily used in East Asian typography as a guide for pronunciation or to include other annotations. In Japanese, this form of typography is also known as “furigana”.
- class ll.xist.ns.html.rp[source]
Bases:
Element
Can be used to provide parentheses around a ruby text component of a ruby annotation, to be shown by user agents that don’t support ruby annotations.
- class ll.xist.ns.html.bdi[source]
Bases:
Element
A span of text that is to be isolated from its surroundings for the purposes of bidirectional text formatting.
- class ll.xist.ns.html.bdo[source]
Bases:
Element
Explicit text directionality formatting control for its children. It allows authors to override the Unicode bidirectional algorithm by explicitly specifying a direction override.
- class ll.xist.ns.html.span[source]
Bases:
Element
Doesn’t mean anything on its own, but can be useful when used together with the global attributes, e.g.
class
,lang
, ordir
. It represents its children.
- class ll.xist.ns.html.embed[source]
Bases:
Element
An integration point for an external (typically non-HTML) application or interactive content.
- class ll.xist.ns.html.object[source]
Bases:
Element
This element can represent an external resource, which, depending on the type of the resource, will either be treated as an image, as a nested browsing context, or as an external resource to be processed by a plugin.
- class ll.xist.ns.html.param[source]
Bases:
Element
Defines parameters for plugins invoked by
object
elements. It does not represent anything on its own.
- class ll.xist.ns.html.video[source]
Bases:
Element
Used for playing videos or movies, and audio files with captions.
- class ll.xist.ns.html.source[source]
Bases:
Element
Allows authors to specify multiple alternative media resources for media elements. It does not represent anything on its own.
- class ll.xist.ns.html.track[source]
Bases:
Element
Allows authors to specify explicit external timed text tracks for media elements. It does not represent anything on its own.
- class ll.xist.ns.html.canvas[source]
Bases:
Element
Provides scripts with a resolution-dependent bitmap canvas, which can be used for rendering graphs, game graphics, art, or other visual images on the fly.
- class ll.xist.ns.html.map[source]
Bases:
Element
Defines an image map in conjunction with any
area
element descendants. The element represents its children.
- class ll.xist.ns.html.area[source]
Bases:
Element
Represents either a hyperlink with some text and a corresponding area on an image map, or a dead area on an image map.
- class ll.xist.ns.html.table[source]
Bases:
Element
Data with more than one dimension, in the form of a table.
The
table
element takes part in the table model. Tables have rows, columns, and cells given by their descendants. The rows and columns form a grid; a table’s cells must completely cover that grid without overlap.
Bases:
Element
The title of the
table
that is its parent.
- class ll.xist.ns.html.colgroup[source]
Bases:
Element
A group of one or more columns in the
table
that is its parent.
- class ll.xist.ns.html.col[source]
Bases:
Element
One or more columns in the column group represented by the
colgroup
that is its parent.
- class ll.xist.ns.html.tbody[source]
Bases:
Element
A block of rows that consist of a body of data for the parent
table
element.
- class ll.xist.ns.html.thead[source]
Bases:
Element
The block of rows that consist of the column labels (headers) for the parent
table
element.
- class ll.xist.ns.html.tfoot[source]
Bases:
Element
The block of rows that consist of the column summaries (footers) for the parent
table
element
- class ll.xist.ns.html.form[source]
Bases:
Element
A collection of form-associated elements, some of which can represent editable values that can be submitted to a server for processing.
- class ll.xist.ns.html.fieldset[source]
Bases:
Element
A set of form controls optionally grouped under a common name.
- class ll.xist.ns.html.legend[source]
Bases:
Element
A caption for the rest of the contents of the legend element’s parent fieldset element, if any.
- class ll.xist.ns.html.label[source]
Bases:
Element
A caption in a user interface. The caption can be associated with a specific form control, known as the label element’s labeled control, either using
for
attribute, or by putting the form control inside the label element itself.
- class ll.xist.ns.html.input[source]
Bases:
Element
A caption in a user interface. The caption can be associated with a specific form control, known as the label element’s labeled control, either using
for
attribute, or by putting the form control inside the label element itself.
- class ll.xist.ns.html.button[source]
Bases:
Element
A button labeled by its contents. The
type
attribute controls the behavior of the button when it is activated.
- class ll.xist.ns.html.select[source]
Bases:
Element
A control for selecting amongst a set of options.
- class ll.xist.ns.html.datalist[source]
Bases:
Element
A set of option elements that represent predefined options for other controls. The contents of the element represents fallback content for legacy user agents, intermixed with
option
elements that represent the predefined options. In the rendering, thedatalist
element represents nothing and it, along with its children, should be hidden.The datalist element is hooked up to an
input
element using thelist
attribute on theinput
element.
- class ll.xist.ns.html.optgroup[source]
Bases:
Element
A group of
option
elements with a common label.
- class ll.xist.ns.html.option[source]
Bases:
Element
An option in a
select
element or as part of a list of suggestions in adatalist
element.
- class ll.xist.ns.html.textarea[source]
Bases:
Element
A multiline plain text edit control for the element’s raw value.
- class ll.xist.ns.html.keygen[source]
Bases:
Element
A key pair generator control. When the control’s form is submitted, the private key is stored in the local keystore, and the public key is packaged and sent to the server.
- class ll.xist.ns.html.output[source]
Bases:
Element
The result of a calculation.
Allows an explicit relationship to be made between the result of a calculation and the elements that represent the values that went into the calculation or that otherwise influenced the calculation.
- class ll.xist.ns.html.progress[source]
Bases:
Element
The completion progress of a task.
The progress is either indeterminate, indicating that progress is being made but that it is not clear how much more work remains to be done before the task is complete (e.g. because the task is waiting for a remote host to respond), or the progress is a number in the range zero to a maximum, giving the fraction of work that has so far been completed.
- class ll.xist.ns.html.meter[source]
Bases:
Element
A scalar measurement within a known range, or a fractional value; for example disk usage, the relevance of a query result, or the fraction of a voting population to have selected a particular candidate.
This is also known as a gauge.
- class ll.xist.ns.html.details[source]
Bases:
Element
A disclosure widget from which the user can obtain additional information or controls.
- class ll.xist.ns.html.summary[source]
Bases:
Element
A summary, caption, or legend for the rest of the contents of the
summary
element’s parentdetails
element, if any.
- class ll.xist.ns.html.command[source]
Bases:
Element
A summary, caption, or legend for the rest of the contents of the
summary
element’s parentdetails
element, if any.
Bases:
Element
A list of commands.
- class ll.xist.ns.html.dialog[source]
Bases:
Element
A part of an application that a user interacts with to perform a task, for example a dialog box, inspector, or window.
- class ll.xist.ns.html.data[source]
Bases:
Element
Microdata element: Contains the name and value of an item property.
- class ll.xist.ns.html.noframes[source]
Bases:
Element
Alternate content container for non frame-based rendering (deprecated).
- class ll.xist.ns.html.acronym[source]
Bases:
Element
Indicates an acronym (e.g., WAC, radar, etc.) (deprecated).
- ll.xist.ns.html.astext(node, width=None, tabwidth=8, default={'display': 'inline'}, h1={'bottom': 1, 'display': 'block', 'overline': '=', 'top': 2, 'underline': '=', 'whitespace': 'nowrap'}, h2={'bottom': 1, 'display': 'block', 'top': 2, 'underline': '-', 'whitespace': 'nowrap'}, h3={'bottom': 1, 'display': 'block', 'top': 2, 'underline': '"', 'whitespace': 'nowrap'}, h4={'bottom': 1, 'display': 'block', 'top': 2, 'underline': "'", 'whitespace': 'nowrap'}, h5={'bottom': 1, 'display': 'block', 'top': 2, 'underline': "'", 'whitespace': 'nowrap'}, h6={'bottom': 1, 'display': 'block', 'top': 2, 'underline': "'", 'whitespace': 'nowrap'}, dl={'bottom': 1, 'display': 'block', 'top': 1}, dt={'display': 'block', 'top': 1}, dd={'bottom': 1, 'display': 'block', 'left': ' '}, ol={'bottom': 1, 'display': 'block', 'top': 1}, ol_li={'bottom': 1, 'display': 'block', 'left': '{pos:{width}}. \n', 'top': 1}, ul={'bottom': 1, 'display': 'block', 'top': 1}, ul_li={'bottom': 1, 'display': 'block', 'left': ('* \n', '- \n'), 'top': 1}, li={'bottom': 1, 'display': 'block', 'top': 1}, pre={'bottom': 1, 'display': 'block', 'left': ' ', 'top': 1, 'whitespace': 'pre'}, blockquote={'bottom': 1, 'display': 'block', 'left': ' ', 'top': 1}, div={'bottom': 1, 'display': 'block'}, p={'bottom': 1, 'display': 'block'}, hr={'bottom': 1, 'display': 'block'}, address={'bottom': 1, 'display': 'block'}, th={'bottom': 1, 'display': 'block'}, td={'bottom': 1, 'display': 'block'}, b={'display': 'inline', 'prefix': '*', 'suffix': '*'}, em={'display': 'inline', 'prefix': '*', 'suffix': '*'}, strong={'display': 'inline', 'prefix': '**', 'suffix': '**'}, i={'display': 'inline', 'prefix': '*', 'suffix': '*'}, u={'display': 'inline', 'prefix': '_', 'suffix': '_'}, code={'display': 'inline', 'prefix': '``', 'suffix': '``'}, **kwargs)[source]
Return the node
node
formatted as plain text.node
must contain an HTML tree.width
is the maximum line length. Ifwidth
isNone
line length is unlimited (i.e. no line wrapping will be done).tabwidth
specifies the number of spaces for tab expansion (the default is 8).The rest of the parameters specify the formatting styles for HTML elements. The parameter names are the names of the HTML elements, except for
ol_li
which is used forli
elements insideol
elements andul_li
which is used forli
elements insideul
elements.default
is used if the parameter for the HTML element is not passed.The parameter value must be a dictionary which might contain any of the following keys (if the key is missing a default value is used):
display
This is either
"block"
for a block level element or"inline"
for an inline element.prefix
A string that should be output before any of the content of the block.
suffix
A string that should be output after any of the content of the block.
The following keys will only be used for
display == "block"
:top
The minimum number of empty lines before the block. (The default is
0
)bottom
The minimum number of empty lines after the block. (The default is
0
)left
The left margin for the block. This margin can be different for different nesting levels (e. g. different “bullets” can be used for nested
ul
s). If the value is a string it will be used as the indentation on the left side for all levels, otherwise it must be a list of strings. If the nesting of this element is deeper than the list, the last item in the list will be used.If a margin contains multiple lines, the first indentation line will be used for the first content line, the second indentation line for the second content line etc. If the content has more lines than the indentation the last indentation line will be repeated. All indentation lines will be padded to the longest line. For example the indentation for a
li
element inside anul
element on level 1 is"* \n"
, i.e. the first line will be indented with"* "
, all subsequent lines with three spaces.right
The right margin for the block. This supports the same semantics regarding levels and multiple lines as the
left
argument.whitespace
Specifies how lines in the block should be wrapped.
"normal"
collapses consecutive whitespace and wraps the lines at the specified width."nowrap"
collapses consecutive whitespace but doesn’t wrap and"pre"
uses the lines as given.overline
A character that is repeated for the width of the content as a rule before the content. If
None
is used, no rule will be output. (Note that this will only work on the innermost block level element.)underline
A rule after the content of the block. (Note that this will only work on the innermost block level element.)