2005-05-06 | paulb | file changeset files shortlog | [project @ 2005-05-06 19:10:17 by paulb] Added a special definition for the multivalue separator. Added extension functions for finding the names of fields for nodes other than the context node. Added conversion functions to translate field names into XPath expressions. Added preparation of template fragments for in-page updates of parts of a document. |
paulb@1 | 1 | #!/usr/bin/env python |
paulb@1 | 2 | |
paulb@1 | 3 | "Prepare a templating stylesheet." |
paulb@1 | 4 | |
paulb@1 | 5 | import XSLForms.Output |
paulb@1 | 6 | import XSLOutput |
paulb@1 | 7 | import libxml2dom |
paulb@1 | 8 | import sys |
paulb@1 | 9 | |
paulb@1 | 10 | if __name__ == "__main__": |
paulb@1 | 11 | try: |
paulb@1 | 12 | input_xml = sys.argv[1] |
paulb@1 | 13 | trans_xsl = sys.argv[2] |
paulb@1 | 14 | output_xml = sys.argv[3] |
paulb@1 | 15 | except IndexError: |
paulb@1 | 16 | print "Please specify an input filename, a template filename and an output filename." |
paulb@1 | 17 | print "For example:" |
paulb@1 | 18 | print "output.py input.xml output.xsl output.xhtml" |
paulb@1 | 19 | sys.exit(1) |
paulb@1 | 20 | |
paulb@1 | 21 | proc = XSLOutput.Processor([trans_xsl]) |
paulb@1 | 22 | proc.send_output(open(output_xml, "wb"), "utf-8", libxml2dom.parse(input_xml)) |
paulb@1 | 23 | |
paulb@1 | 24 | # vim: tabstop=4 expandtab shiftwidth=4 |