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:
DocTypedocument type for HTML 4.0 transitional
- class ll.xist.ns.html.DocTypeHTML401transitional[source]
Bases:
DocTypedocument type for HTML 4.01 transitional
- class ll.xist.ns.html.DocTypeXHTML10strict[source]
Bases:
DocTypedocument type for XHTML 1.0 strict
- class ll.xist.ns.html.DocTypeXHTML10transitional[source]
Bases:
DocTypedocument type for XHTML 1.0 transitional
- class ll.xist.ns.html.GlobalAttrs[source]
Bases:
AttrsAttributes that are common to and may be specified on all HTML elements
- class accesskey[source]
Bases:
TextAttrThis 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:
TextAttrThis 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:
TextAttrThe element’s context menu. The value must be the ID of a menu element in the DOM.
- class dropzone[source]
Bases:
TextAttrSpecifies which types of objects are allowed to be dropped on the element and how they are handled.
Bases:
BoolAttrWhen 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:
TextAttrSpecifies the primary language for the element’s contents and for any of the element’s attributes that contain text.
- class spellcheck[source]
Bases:
TextAttrSpecifies whether the user agent should indicate spelling and/or grammar errors in content of the element.
- class tabindex[source]
Bases:
IntAttrSpecifies 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:
TextAttrAdvisory information for the element, such as would be appropriate for a tooltip.
- class translate[source]
Bases:
TextAttrAn 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:
TextAttrIf 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:
TextAttrEvent handler
- class itemscope[source]
Bases:
BoolAttrMicrodata attribute: Creates a new item, a group of name-value pairs.
- class ll.xist.ns.html.base[source]
Bases:
ElementAllows 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:
ElementAllows authors to link their document to other resources.
- class ll.xist.ns.html.meta[source]
Bases:
ElementVarious kinds of metadata that cannot be expressed using the
title,base,link,style, andscriptelements.
- class ll.xist.ns.html.style[source]
Bases:
ElementAllows authors to embed style information in their documents.
- class ll.xist.ns.html.script[source]
Bases:
ElementAllows authors to include dynamic script and data blocks in their documents.
- class ll.xist.ns.html.noscript[source]
Bases:
ElementRepresents nothing if scripting is enabled, and represents its children if scripting is disabled.
- class ll.xist.ns.html.article[source]
Bases:
ElementA 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:
ElementA generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading.
Bases:
ElementA 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:
ElementA 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:
ElementBase class of
h1,h2,h3,h4,h5andh6, which represent headings for their sections.
- class ll.xist.ns.html.hgroup[source]
Bases:
ElementThe heading of a section. The element is used to group a set of
h1–h6elements when the heading has multiple levels, such as subheadings, alternative titles, or taglines.
Bases:
ElementA 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:
ElementThe contact information for its nearest
articleorbodyelement ancestor.
- class ll.xist.ns.html.hr[source]
Bases:
ElementA 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:
ElementA block of preformatted text, in which structure is represented by typographic conventions rather than by elements.
- class ll.xist.ns.html.blockquote[source]
Bases:
ElementA section that is quoted from another source.
- class ll.xist.ns.html.ol[source]
Bases:
ElementA 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:
ElementA 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:
ElementAn association list consisting of zero or more name-value groups (a description list). Each group must consist of one or more names (
dtelements) followed by one or more values (ddelements). Within a single dl element, there should not be more than onedtelement 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:
ElementThe term, or name, part of a term-description group in a description list (
dlelement).
- class ll.xist.ns.html.dd[source]
Bases:
ElementThe description, definition, or value, part of a term-description group in a description list (
dlelement).
- class ll.xist.ns.html.figure[source]
Bases:
ElementSome 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.
- class ll.xist.ns.html.figcaption[source]
Bases:
ElementA caption or legend for the rest of the contents of the
figcaptionelement’s parentfigureelement, if any.
- class ll.xist.ns.html.div[source]
Bases:
ElementThe
divelement has no special meaning at all. It represents its children. It can be used with theclass,lang, andtitleattributes to mark up semantics common to a group of consecutive elements.
- class ll.xist.ns.html.a[source]
Bases:
ElementIf the
aelement has anhrefattribute, then it represents a hyperlink (a hypertext anchor) labeled by its contents.If the
aelement has nohrefattribute, 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:
ElementContents that are no longer accurate or no longer relevant.
- class ll.xist.ns.html.cite[source]
Bases:
ElementThe 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:
ElementThe defining instance of a term. The paragraph, description list group, or section that is the nearest ancestor of the
dfnelement must also contain the definition(s) for the term given by thedfnelement.
- class ll.xist.ns.html.abbr[source]
Bases:
ElementAn abbreviation or acronym, optionally with its expansion. The
titleattribute 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:
ElementRepresents its contents, along with a machine-readable form of those contents in the
datetimeattribute.
- class ll.xist.ns.html.code[source]
Bases:
ElementA 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:
ElementA 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:
ElementA (sample) output from a program or computing system.
- class ll.xist.ns.html.kbd[source]
Bases:
ElementUser 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:
ElementA 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:
ElementA 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:
ElementA 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:
ElementA 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:
ElementAllows 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:
ElementCan 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:
ElementA 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:
ElementExplicit 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:
ElementDoesn’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:
ElementAn integration point for an external (typically non-HTML) application or interactive content.
- class ll.xist.ns.html.object[source]
Bases:
ElementThis 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:
ElementDefines parameters for plugins invoked by
objectelements. It does not represent anything on its own.
- class ll.xist.ns.html.video[source]
Bases:
ElementUsed for playing videos or movies, and audio files with captions.
- class ll.xist.ns.html.source[source]
Bases:
ElementAllows 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:
ElementAllows 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:
ElementProvides 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:
ElementDefines an image map in conjunction with any
areaelement descendants. The element represents its children.
- class ll.xist.ns.html.area[source]
Bases:
ElementRepresents 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:
ElementData with more than one dimension, in the form of a table.
The
tableelement 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.
- class ll.xist.ns.html.colgroup[source]
Bases:
ElementA group of one or more columns in the
tablethat is its parent.
- class ll.xist.ns.html.col[source]
Bases:
ElementOne or more columns in the column group represented by the
colgroupthat is its parent.
- class ll.xist.ns.html.tbody[source]
Bases:
ElementA block of rows that consist of a body of data for the parent
tableelement.
- class ll.xist.ns.html.thead[source]
Bases:
ElementThe block of rows that consist of the column labels (headers) for the parent
tableelement.
- class ll.xist.ns.html.tfoot[source]
Bases:
ElementThe block of rows that consist of the column summaries (footers) for the parent
tableelement
- class ll.xist.ns.html.form[source]
Bases:
ElementA 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:
ElementA set of form controls optionally grouped under a common name.
- class ll.xist.ns.html.legend[source]
Bases:
ElementA 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:
ElementA 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
forattribute, or by putting the form control inside the label element itself.
- class ll.xist.ns.html.input[source]
Bases:
ElementA 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
forattribute, or by putting the form control inside the label element itself.
- class ll.xist.ns.html.button[source]
Bases:
ElementA button labeled by its contents. The
typeattribute controls the behavior of the button when it is activated.
- class ll.xist.ns.html.select[source]
Bases:
ElementA control for selecting amongst a set of options.
- class ll.xist.ns.html.datalist[source]
Bases:
ElementA 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
optionelements that represent the predefined options. In the rendering, thedatalistelement represents nothing and it, along with its children, should be hidden.The datalist element is hooked up to an
inputelement using thelistattribute on theinputelement.
- class ll.xist.ns.html.optgroup[source]
Bases:
ElementA group of
optionelements with a common label.
- class ll.xist.ns.html.option[source]
Bases:
ElementAn option in a
selectelement or as part of a list of suggestions in adatalistelement.
- class ll.xist.ns.html.textarea[source]
Bases:
ElementA multiline plain text edit control for the element’s raw value.
- class ll.xist.ns.html.keygen[source]
Bases:
ElementA 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:
ElementThe 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:
ElementThe 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:
ElementA 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:
ElementA disclosure widget from which the user can obtain additional information or controls.
- class ll.xist.ns.html.summary[source]
Bases:
ElementA summary, caption, or legend for the rest of the contents of the
summaryelement’s parentdetailselement, if any.
- class ll.xist.ns.html.command[source]
Bases:
ElementA summary, caption, or legend for the rest of the contents of the
summaryelement’s parentdetailselement, if any.
Bases:
ElementA list of commands.
- class ll.xist.ns.html.dialog[source]
Bases:
ElementA 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:
ElementMicrodata element: Contains the name and value of an item property.
- class ll.xist.ns.html.noframes[source]
Bases:
ElementAlternate content container for non frame-based rendering (deprecated).
- class ll.xist.ns.html.acronym[source]
Bases:
ElementIndicates 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
nodeformatted as plain text.nodemust contain an HTML tree.widthis the maximum line length. IfwidthisNoneline length is unlimited (i.e. no line wrapping will be done).tabwidthspecifies 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_liwhich is used forlielements insideolelements andul_liwhich is used forlielements insideulelements.defaultis 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):
displayThis is either
"block"for a block level element or"inline"for an inline element.prefixA string that should be output before any of the content of the block.
suffixA string that should be output after any of the content of the block.
The following keys will only be used for
display == "block":topThe minimum number of empty lines before the block. (The default is
0)bottomThe minimum number of empty lines after the block. (The default is
0)leftThe left margin for the block. This margin can be different for different nesting levels (e. g. different “bullets” can be used for nested
uls). 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
lielement inside anulelement on level 1 is"* \n", i.e. the first line will be indented with"* ", all subsequent lines with three spaces.rightThe right margin for the block. This supports the same semantics regarding levels and multiple lines as the
leftargument.whitespaceSpecifies 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.overlineA character that is repeated for the width of the content as a rule before the content. If
Noneis used, no rule will be output. (Note that this will only work on the innermost block level element.)underlineA rule after the content of the block. (Note that this will only work on the innermost block level element.)