Hi,
newbie, here... I have been studying up, reading through documentation and
articles. I have gotten hunchentoot up and running behind mod_lisp and
written some basic, test webapps. But, I want to use XSL (version 1.0 is
my current preference) in my view layer.
From reading this group's archives I see that XML is not the most
appreciated. (The only thing I can say to that is can't you see that angle
brackets are better for breaking through traffic and more aerodynamically
shaped for shooting through the pipes than parans?)
Anyway, I come from java and enjoy the tools available for XSL
transformations (not just) in my view layer. I would like to be able to
the XSL transforms for a webapp in lisp. I would also like to be able to
use other languages behind the same XSL view layer.
Do people here use XSL in/from lisp? If so, how? I would prefer not to run
lisp in a JVM to access java XSL libraries.
I am learning lisp to be able to see programming differently and if I
reach the lisp nirvana moment, all the better.
best,
-Rob
Rob Koberg wrote:
> Do people here use XSL in/from lisp? If so, how? I would prefer not to
> run lisp in a JVM to access java XSL libraries.
If you actually actively prefer writing XSL transformations to writing
Lisp, you're probably using the wrong language. :-). Still, if you can
write XSLT, Lisp should come easy to you.
For original XSLT-like transforms in lisp, it's probably preferred by
most lispers to just Lispify the XML and transform with
commonplace-in-lisp lisp-transforming-lisp techniques, then XMLize
again at final output. Closure XML is one nice suite of XML handling
stuff that can help with that [1].
I'm not myself aware of any XSLT engine implemented in lisp (doesn't
mean one doesn't exist!), but I imagine it could be written fairly
easily (though still time consuming to write due to the usual XML-land
minutiae, I'm not volunteering...)
If you simply have to deal with applying XSLTs supplied by third
parties, or just really, really, really want to use XSLT, one
low-performance-but-possibly-good-enough-especially-with-caching
approach is just to call out to a command-line XSLT processor like
xsltproc - mainstream lisp implementations all provide ways
to call out to system executables. For higher performance, you could
perhaps FFI out to libxml2/libxslt, but that's probably more bother
than it's worth.
[1] http://common-lisp.net/project/cxml/
On Sat, 02 Feb 2008 14:07:53 -0500, David Golden
<············@oceanfree.net> wrote:
> Rob Koberg wrote:
>
>
>> Do people here use XSL in/from lisp? If so, how? I would prefer not to
>> run lisp in a JVM to access java XSL libraries.
>
>
> If you actually actively prefer writing XSL transformations to writing
> Lisp, you're probably using the wrong language. :-). Still, if you can
> write XSLT, Lisp should come easy to you.
Since moving from SF to New Hampshire I have no access to mind altering
drugs. So, thought I would try lisp.
I like writing XSL, but I like to seperate the concern of the view layer
from other concerns. Basically, a designer-type creates a regular
(well-formed) HTML page to be used as the template in the transform (kind
of like Page Templates in Zope/python). The transform also uses XML
provided by a (java or python or lisp or whatev) control layer to fill in
the template.
>
> For original XSLT-like transforms in lisp, it's probably preferred by
> most lispers to just Lispify the XML and transform with
> commonplace-in-lisp lisp-transforming-lisp techniques, then XMLize
> again at final output. Closure XML is one nice suite of XML handling
> stuff that can help with that [1].
I will look into Closure XML. I saw 'cxml' mentioned in previous threads,
but when I searched for it I received nothing that linked me to it (or
gave up to early). Still, if I have to lispify my transform, it defeats
the portability purpose. XSL is portable. I can't find another templating
system that is.
>
> I'm not myself aware of any XSLT engine implemented in lisp (doesn't
> mean one doesn't exist!), but I imagine it could be written fairly
> easily (though still time consuming to write due to the usual XML-land
> minutiae, I'm not volunteering...)
>
> If you simply have to deal with applying XSLTs supplied by third
> parties, or just really, really, really want to use XSLT, one
> low-performance-but-possibly-good-enough-especially-with-caching
> approach is just to call out to a command-line XSLT processor like
> xsltproc - mainstream lisp implementations all provide ways
> to call out to system executables.
That is what I thought. I am hoping someone chimes in to say there is an
XSL processor that can be called from lisp (which allows for caching of
something like the javax.xml.transform.Templates object in java).
> For higher performance, you could
> perhaps FFI out to libxml2/libxslt, but that's probably more bother
> than it's worth.
OK, thanks.
-Rob
>
> [1] http://common-lisp.net/project/cxml/
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
On Feb 2, 8:38 pm, "Rob Koberg" <····@koberg.com> wrote:
> Since moving from SF to New Hampshire I have no access to mind altering
> drugs. So, thought I would try lisp.
Better watch what you're doing, Lisp is the red pill, the most potent
drug on Earth, it could esily swallow you.
Slobodan
http://tourdelisp.blogspot.com/
On Sat, 02 Feb 2008 14:38:30 -0500, "Rob Koberg" <···@koberg.com> wrote:
> Since moving from SF to New Hampshire I have no access to mind
> altering drugs. So, thought I would try lisp.
Hehe, nice one. I'll keep that in mind for my sig once the ECLM is
over... :)
--
European Common Lisp Meeting, Amsterdam, April 19/20, 2008
http://weitz.de/eclm2008/
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
RK> I like writing XSL, but I like to seperate the concern of the view
RK> layer from other concerns. Basically, a designer-type creates a
RK> regular (well-formed) HTML page to be used as the template in the
RK> transform (kind of like Page Templates in Zope/python).
RK> The transform also uses XML provided by a (java or python or lisp or
RK> whatev) control layer to fill in the template.
so maybe you just need HTML templating stuff?
e.g. UCW uses TAL that should be close to Zope's one:
http://www.cliki.net/ucwTutorialIntroducingTal
if you really need XSLT, i remember there was some for Scheme: XSieve
http://xsieve.sourceforge.net/
but i have no clue if it's good or not..
On 2008-02-02, Rob Koberg <···@koberg.com> wrote:
> Do people here use XSL in/from lisp? If so, how? I would prefer not to run
> lisp in a JVM to access java XSL libraries.
Ivan Shvedunov has been working on an implementation of XPath 1.0 for
cxml, which is nearly finished. It is called Plexippus XPath and can be
found at http://common-lisp.net/project/plexippus-xpath/.
Based on that, we are also working on an implementation of XSLT 1.0
called Xuriella XSLT, currently available only from git at
http://repo.or.cz/w/xuriella.git
Beware that Xuriella is not finished yet; some trivial examples already
work, but many important features are missing completely.
I think that having an XSLT implementation in Lisp is important, and
hopefully I will soon find the time for more work on Xuriella. Stay
tuned!
(Until then, you might want to use FFI to interface with libxslt.)
d.
On Sat, 02 Feb 2008 14:32:39 -0500, David Lichteblau
<···········@lichteblau.com> wrote:
> On 2008-02-02, Rob Koberg <···@koberg.com> wrote:
>> Do people here use XSL in/from lisp? If so, how? I would prefer not to
>> run
>> lisp in a JVM to access java XSL libraries.
>
> Ivan Shvedunov has been working on an implementation of XPath 1.0 for
> cxml, which is nearly finished. It is called Plexippus XPath and can be
> found at http://common-lisp.net/project/plexippus-xpath/.
>
> Based on that, we are also working on an implementation of XSLT 1.0
> called Xuriella XSLT, currently available only from git at
> http://repo.or.cz/w/xuriella.git
Great! I will give it a try. Just got to get git, I guess.
thanks,
-Rob
>
> Beware that Xuriella is not finished yet; some trivial examples already
> work, but many important features are missing completely.
>
> I think that having an XSLT implementation in Lisp is important, and
> hopefully I will soon find the time for more work on Xuriella. Stay
> tuned!
>
> (Until then, you might want to use FFI to interface with libxslt.)
>
>
> d.
P� Sat, 02 Feb 2008 19:35:53 +0100, skrev Rob Koberg <···@koberg.com>:
> Hi,
>
> newbie, here... I have been studying up, reading through documentation
> and articles. I have gotten hunchentoot up and running behind mod_lisp
> and written some basic, test webapps. But, I want to use XSL (version
> 1.0 is my current preference) in my view layer.
>
> From reading this group's archives I see that XML is not the most
> appreciated. (The only thing I can say to that is can't you see that
> angle brackets are better for breaking through traffic and more
> aerodynamically shaped for shooting through the pipes than parans?)
>
> Anyway, I come from java and enjoy the tools available for XSL
> transformations (not just) in my view layer. I would like to be able to
> the XSL transforms for a webapp in lisp. I would also like to be able to
> use other languages behind the same XSL view layer.
>
> Do people here use XSL in/from lisp? If so, how? I would prefer not to
> run lisp in a JVM to access java XSL libraries.
>
> I am learning lisp to be able to see programming differently and if I
> reach the lisp nirvana moment, all the better.
>
> best,
> -Rob
Don't think one exists yet, but you can go down the same path as PHP.
Use a separate xslt dll/so and use the foreign function interface to
access it.
http://www.gingerall.org/sablotron.html contains xslt and xpath..
I would only recommend this over cxml and using lisp functions if you
already have large amounts of processing for xslt.
--------------
John Thingstad