This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Saxon and Python
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Saxon and Python
- From: Lars Marius Garshol <larsga at garshol dot priv dot no>
- Date: 11 Jun 2001 10:26:18 +0200
- References: <000e01c0f24b$feb92770$9b3b3c3e@PCUKMKA>
- Reply-To: xsl-list at lists dot mulberrytech dot com
* Gustaf Liljegren
|
| I need to write an XSLT extension, and the language of choise for me
| right now is Python. Is there any hope that I can write extentions
| in Python that works in Instant Saxon, or Saxon?
* Michael Kay
|
| Only if you can make your Python code look to Saxon like a Java
| class, e.g. by writing a wrapper.
This is no problem at all with Jython.
[larsga@pc36 larsga]$ jython
Jython 2.0 on java1.3.0 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> from java.util import HashMap
>>> class DemoClass:
... def say_hello(self):
... print "I'm a Python object!"
...
>>> hash = HashMap()
>>> hash.put("hello", DemoClass())
>>> hash.get("hello").say_hello()
I'm a Python object!
--Lars M.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list