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.
Content
- XIST examples
- Basic XIST concepts
- Iterating through XIST trees
- Transforming XIST trees
- Advanced topics
- Miscellaneous features
xsc– XIST core classestonode()buildaddattradd()ContextErrorWarningIllegalAttrValueWarningRequiredAttrMissingWarningUndeclaredAttrWarningUndeclaredNodeWarningIllegalPrefixErrorFileNotFoundWarningIllegalObjectErrorIllegalCommentContentWarningIllegalProcInstFormatErrorConverterPublisherCursorNodeCharacterDataTextFragCommentDocTypeProcInstAttrTextAttrIDAttrNumberAttrIntAttrFloatAttrBoolAttrColorAttrStyleAttrURLAttrAttrsElementAttrElementEntityCharRefPooldocpool()nsname()nsclark()quotampltgtaposelement()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()SelectorAnySelectorIsInstanceSelectorelementprocinstentityIsSelectorIsRootSelectorIsEmptySelectorOnlyChildSelectorOnlyOfTypeSelectorhasattrattrhasvalueattrcontainsattrstartswithattrendswithhasidhasclassInAttrSelectorCombinatorBinaryCombinatorChildCombinatorDescendantCombinatorAdjacentSiblingCombinatorGeneralSiblingCombinatorChainedCombinatorOrCombinatorAndCombinatorNotCombinatorCallableSelectornthchildnthoftype
css– CSS related functionsreplaceurls()geturls()iterrules()applystylesheets()CSSWeightedSelectorCSSHasAttributeSelectorCSSAttributeListSelectorCSSAttributeLangSelectorCSSFirstChildSelectorCSSLastChildSelectorCSSFirstOfTypeSelectorCSSLastOfTypeSelectorCSSOnlyChildSelectorCSSOnlyOfTypeSelectorCSSEmptySelectorCSSRootSelectorCSSLinkSelectorCSSDisabledSelectorCSSFunctionSelectorCSSNthChildSelectorCSSNthLastChildSelectorCSSNthOfTypeSelectorCSSNthLastOfTypeSelectorCSSAdjacentSiblingCombinatorCSSGeneralSiblingCombinatorselector()parsestring()parsestream()parsefile()parseurl()
scripts– XIST related scripts