XSLTools

scripts/xslform_output.py

233:15159e66b39a
2005-09-30 paulb [project @ 2005-09-30 22:53:43 by paulb] Added special "macro" attribute support: simpler attributes for use in templates. Also added experimental stylesheets for schema creation and for the production of generic processing stylesheets.
     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 "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