ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xml-sig
xml-sig
Re: [XML-SIG] XSLT 2.0 implementation in Python?
by Stefan Behnel other posts by this author
Jun 18 2009 5:54AM messages near this date
[XML-SIG] XSLT 2.0 implementation in Python? | Re: [XML-SIG] XSLT 2.0 implementation in Python?
& XSLT Christof Hoeke wrote:
> > I just wanted to ask if there's any Python XML implementation which
> > supports XSLT 2.0 (e.g. <xsl:analyte-text>). The only thing I found was
> > Saxon, but it's only for Java/.NET (and I don't want to use Jython).
> 
>  Only option to use Java/Saxon via Python would to be call Saxon a an os
>  command and pipe the result back to your Python program.

Sounds awfully slow, given the startup time of the average JVM, plus the
time it takes hotspot to heat up.

There's also JPype, GCJ or JCC if running Java is an option, see e.g.

http://ubuntuforums.org/archive/index.php/t-593327.html

http://pypi.python.org/pypi/JCC/
http://jpype.sourceforge.net/


>  you still need Java in addition to Python but at least write your
>  program in (C)Python. Also you cannot transform any e.g. lxml tree
>  directly, you would have to reserialize any XML.

Should I say it? Serialisation and parsing are *fast* in lxml - don't know
about Saxon in Java, though. But given that both XSLT input and output can
be streamed, the I/O performance might not be that much of a problem
either (assuming large documents). Benchmarks will tell.

You could also write an HTTP based transformation service in Jython that
calls Saxon, and just run it in a permanently running JVM.

Stefan

_______________________________________________
XML-SIG maillist  -  XML-SIG@[...].org
http://mail.python.org/mailman/listinfo/xml-sig
Thread:
Andreas Sommer
Christof Hoeke
Stefan Behnel
Stefan Behnel

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved