# HG changeset patch # User paulb # Date 1128120750 0 # Node ID f4a48f149140cc2e5135609050bb9b62e9f40d00 # Parent ce9a456466e58a56eef5cce6253a7d4840753e65 [project @ 2005-09-30 22:52:30 by paulb] Added special "macro" attribute support. diff -r ce9a456466e5 -r f4a48f149140 XSLForms/Prepare.py --- a/XSLForms/Prepare.py Sat Sep 10 23:53:33 2005 +0000 +++ b/XSLForms/Prepare.py Fri Sep 30 22:52:30 2005 +0000 @@ -26,14 +26,13 @@ resource_dir = os.path.join(os.path.split(__file__)[0], "XSL") -def make_stylesheet(template_name, output_name, stylesheet_name="Prepare.xsl", encoding="utf-8"): - global resource_dir - proc = XSLOutput.Processor([os.path.join(resource_dir, stylesheet_name)]) +def make_stylesheet(template_name, output_name, stylesheet_names=["PrepareMacro.xsl", "Prepare.xsl"], encoding="utf-8"): + stylesheets = [os.path.join(resource_dir, stylesheet_name) for stylesheet_name in stylesheet_names] + proc = XSLOutput.Processor(stylesheets) template = libxml2dom.parse(template_name) proc.send_output(open(output_name, "wb"), encoding, template) def make_stylesheet_fragment(template_name, output_name, element_id, stylesheet_name="Extract.xsl", encoding="utf-8"): - global resource_dir proc = XSLOutput.Processor([os.path.join(resource_dir, stylesheet_name)], parameters={"element-id" : element_id}) template = libxml2dom.parse(template_name) proc.send_output(open(output_name, "wb"), encoding, template)