Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to smartly rewrite a python script that used to use XSLT?

I have an old python app that used to use XSLT to transform some XML data (two types of xml files with their respective xslt ones) to produce html output.

I'd like to port this app to appengine, but, sadly, appengine's python version doesn't support xslt.

Is there an easy way to rewrite my code without manually parsing and checking for given tags in the xml inputs?

in other words, do you have any idea of a generic way to do this?

Thanks and sorry for my poor english!

like image 995
Liza Avatar asked Nov 04 '22 20:11

Liza


1 Answers

Unfortunately there is no working XSLT implementation in pure python. You may be able to adapt your python code to run on jython, which would give you access to java's XSLT implementation. This is described in this blog post.

You will have to decide if porting/testing your existing code to jython is a better option than writing your own case specific xml parser/transformer.

like image 126
anthony Avatar answered Nov 12 '22 16:11

anthony