This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Saxon and Python



* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]