XSLTools

scripts/output.py

3:e96db0ca6952
2004-12-20 paulb [project @ 2004-12-20 18:55:20 by paulb] Fixed module docstring. Added a parameter so that values which are lists of actual values may be handled. Exposed instance creation as a "public" method.
     1 #!/usr/bin/env python     2      3 "Prepare a templating stylesheet."     4      5 import XSLForms.Output     6 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 "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