XIST – An extensible HTML/XML generator
XIST is an extensible HTML and XML generator. XIST is also a XML parser with a very simple and pythonesque tree API. Every XML element type corresponds to a Python class and these Python classes provide a conversion method to transform the XML tree (e.g. into HTML). XIST can be considered ‘object oriented XSLT’.
XIST was written as a replacement for the HTML preprocessor HSC, and borrows some features and ideas from it.
It also borrows the basic idea (XML/HTML elements as Python objects) from the
ancient Python modules HTMLgen
and HyperText
.
- XIST examples
- Basic XIST concepts
- Iterating through XIST trees
- Transforming XIST trees
- Advanced topics
- Miscellaneous features
xsc
– XIST core classestonode()
build
addattr
add()
Context
Error
Warning
IllegalAttrValueWarning
RequiredAttrMissingWarning
UndeclaredAttrWarning
UndeclaredNodeWarning
IllegalPrefixError
FileNotFoundWarning
IllegalObjectError
IllegalCommentContentWarning
IllegalProcInstFormatError
Converter
Publisher
Cursor
Node
CharacterData
Text
Frag
Comment
DocType
ProcInst
Attr
TextAttr
IDAttr
NumberAttr
IntAttr
FloatAttr
BoolAttr
ColorAttr
StyleAttr
URLAttr
Attrs
Element
AttrElement
Entity
CharRef
Pool
docpool()
nsname()
nsclark()
quot
amp
lt
gt
apos
element()
entity()
procinst()
Location
ns
– Package containing namespaceshtml
– HTML namespacexml
– Global attributes from the XML namespacedocbook
– DocBook 5.0svg
– SVG 1.1abbr
– Abbreviation entitiescode
– Embedding Python code in XMLform
– Form related elementsphp
– PHP processing instructionsjsp
– JSP processing instructionsmeta
– HTML meta informationruby
– W3C Ruby annotationsspecials
– Common useful elementshtmlspecials
– Elements for HTML generationdoc
– Automated documentation generationdetox
– Detox templatestoxic
– Embed PL/SQL in XIST XMLrng
– Relax NGrss091
– RSS 0.91rss20
– RSS 2.0atom
– Atom 1.0struts_html
– Jakarta Struts HTML tagsstruts_config
– Struts configuration files
parse
– Parsing XML/HTMLpresent
– Screen output of XML treessims
– Simple schema validationxfind
– Tree traversal and filteringfilter()
selector()
Selector
AnySelector
IsInstanceSelector
element
procinst
entity
IsSelector
IsRootSelector
IsEmptySelector
OnlyChildSelector
OnlyOfTypeSelector
hasattr
attrhasvalue
attrcontains
attrstartswith
attrendswith
hasid
hasclass
InAttrSelector
Combinator
BinaryCombinator
ChildCombinator
DescendantCombinator
AdjacentSiblingCombinator
GeneralSiblingCombinator
ChainedCombinator
OrCombinator
AndCombinator
NotCombinator
CallableSelector
nthchild
nthoftype
css
– CSS related functionsreplaceurls()
geturls()
iterrules()
applystylesheets()
CSSWeightedSelector
CSSHasAttributeSelector
CSSAttributeListSelector
CSSAttributeLangSelector
CSSFirstChildSelector
CSSLastChildSelector
CSSFirstOfTypeSelector
CSSLastOfTypeSelector
CSSOnlyChildSelector
CSSOnlyOfTypeSelector
CSSEmptySelector
CSSRootSelector
CSSLinkSelector
CSSDisabledSelector
CSSFunctionSelector
CSSNthChildSelector
CSSNthLastChildSelector
CSSNthOfTypeSelector
CSSNthLastOfTypeSelector
CSSAdjacentSiblingCombinator
CSSGeneralSiblingCombinator
selector()
parsestring()
parsestream()
parsefile()
parseurl()
scripts
– XIST related scripts