XSLTools

scripts/xslform_output.py

389:c78d5648e820
2005-11-08 paulb [project @ 2005-11-08 19:01:58 by paulb] Added scripts (although they are not yet used).
     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