1.1 --- a/XSLForms/Prepare.py Sat Sep 10 23:53:33 2005 +0000
1.2 +++ b/XSLForms/Prepare.py Fri Sep 30 22:52:30 2005 +0000
1.3 @@ -26,14 +26,13 @@
1.4
1.5 resource_dir = os.path.join(os.path.split(__file__)[0], "XSL")
1.6
1.7 -def make_stylesheet(template_name, output_name, stylesheet_name="Prepare.xsl", encoding="utf-8"):
1.8 - global resource_dir
1.9 - proc = XSLOutput.Processor([os.path.join(resource_dir, stylesheet_name)])
1.10 +def make_stylesheet(template_name, output_name, stylesheet_names=["PrepareMacro.xsl", "Prepare.xsl"], encoding="utf-8"):
1.11 + stylesheets = [os.path.join(resource_dir, stylesheet_name) for stylesheet_name in stylesheet_names]
1.12 + proc = XSLOutput.Processor(stylesheets)
1.13 template = libxml2dom.parse(template_name)
1.14 proc.send_output(open(output_name, "wb"), encoding, template)
1.15
1.16 def make_stylesheet_fragment(template_name, output_name, element_id, stylesheet_name="Extract.xsl", encoding="utf-8"):
1.17 - global resource_dir
1.18 proc = XSLOutput.Processor([os.path.join(resource_dir, stylesheet_name)], parameters={"element-id" : element_id})
1.19 template = libxml2dom.parse(template_name)
1.20 proc.send_output(open(output_name, "wb"), encoding, template)