Package pyxslt :: Module transform
[frames | no frames]

Module pyxslt.transform

Convert a tree of Python objects into an XML document using an XSL template.

The toString function is responsible for transforming one or more Python objects into an XML document by way of an XSL template. This function accepts the same list of Python objects as serialize.toString, but transforms the serialized Python objects into an XML file using an XSL template. toString performs the serialization step internally, so calling serialize.serialize is not required.

Author: Michael Alyn Miller <malyn@strangeGizmo.com>

Copyright: 2006 by Michael Alyn Miller

License: BSD License (see source code for full license)

Classes
EntityLoader libxml2 callback that applies a base path to all absolute stylesheet references.

Function Summary
str toString(xslPath, xslParams, xslBasePath, rootTagName, encoding, prettyPrintXml, **elements)
Serialize a dictionary of Python objects to an XML document, transform that document using an XSL template, then return the textual version of the document.

Function Details

toString(xslPath, xslParams=None, xslBasePath=None, rootTagName='pyxslt', encoding='ASCII', prettyPrintXml=False, **elements)

Serialize a dictionary of Python objects to an XML document, transform that document using an XSL template, then return the textual version of the document.
Parameters:
xslPath - The path to the XSL file that should be used to transform the serialized Python objects.
           (type=str containing the path to an XSL stylesheet.)
xslParams - Parameters to pass to the XSL stylesheet.
           (type=dict)
xslBasePath - The path to prepend to absolute stylesheet references.
           (type=str)
rootTagName - The name of the XML tag that will enclose the serialized Python objects.
           (type=str)
encoding - The character encoding to use when outputting the final XML document. Values such as UTF-8, ISO-8859-1, ASCII, etc. are appropriate.
           (type=str)
prettyPrintXml - True to indent the final XML output, False to return the bare XML without any extraneous spaces or linefeeds.
           (type=bool)
Returns:
The given Python objects as a transformed XML document.
           (type=str)

Generated by Epydoc 2.1 on Wed Jul 12 11:19:10 2006 http://epydoc.sf.net