Parsing and Compiling XML

Parse XML and compile to TALInterpreter intermediate code, using a TALGenerator.

class zope.tal.talparser.TALParser(gen=None, encoding=None)[source]

Bases: zope.tal.xmlparser.XMLParser

Parser for XML.

After parsing with parseFile(), parseString(), parseURL() or parseStream(), you can call getCode() to retrieve the parsed program and macros.

Parameters:gen (TALGenerator) – The configured (with an expression compiler) code generator to use. If one is not given, a default will be used.

Return the compiled program and macros after parsing.

class zope.tal.xmlparser.XMLParser(encoding=None)[source]

Bases: object

Parse XML using xml.parsers.expat.


Parse from the given filename.


Parse the given string.


Parse the given URL.


Parse the given stream (open file).