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.
getCode()[source]

Return the compiled program and macros after parsing.

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

Bases: object

Parse XML using xml.parsers.expat.

parseFile(filename)[source]

Parse from the given filename.

parseString(s)[source]

Parse the given string.

parseURL(url)[source]

Parse the given URL.

parseStream(stream)[source]

Parse the given stream (open file).