XSLTools

scripts/xslform_output.py

377:7fb43f2befb0
2005-11-01 paulb [project @ 2005-11-01 18:58:15 by paulb] Added memory and storage unit initialisation.
     1 #!/usr/bin/env python     2      3 "Prepare a templating stylesheet."     4      5 import XSLForms.Output     6 from XSLTools import XSLOutput     7 import libxml2dom     8 import sys     9     10 if __name__ == "__main__":    11     try:    12         input_xml = sys.argv[1]    13         trans_xsl = sys.argv[2]    14         output_xml = sys.argv[3]    15     except IndexError:    16         print "Please specify an input filename, a template filename and an output filename."    17         print "For example:"    18         print "xslform_output.py input.xml output.xsl output.xhtml"    19         sys.exit(1)    20     21     proc = XSLOutput.Processor([trans_xsl])    22     proc.send_output(open(output_xml, "wb"), "utf-8", libxml2dom.parse(input_xml))    23     24 # vim: tabstop=4 expandtab shiftwidth=4