Return to Snippet

Revision: 31517
at September 8, 2010 18:25 by sukantahazra


Initial Code
import libxml2
import libxslt
import sys

if (len(sys.argv) != 4):
        print "Usage: "+sys.argv[0]+" xsltfile xmlfile outputfile"
        sys.exit(1)

styledoc = libxml2.parseFile(sys.argv[1])
style = libxslt.parseStylesheetDoc(styledoc)
doc = libxml2.parseFile(sys.argv[2])
result = style.applyStylesheet(doc, None)
style.saveResultToFilename(sys.argv[3], result, 0)
style.freeStylesheet()
doc.freeDoc()
result.freeDoc()

Initial URL

                                

Initial Description

                                

Initial Title
XSLT processing in python

Initial Tags
python, xml

Initial Language
Python