- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
XSLT?
Fri, 2009-12-04, 17:24
I'm in the process of moving an application currently implemented in
Java using Apache Cocoon to Scala and Liftweb. I've had a relatively
easy time moving the `plumbing' of the app over -- sessions, users,
dynamic content and so on -- but a lot of the app's presentation is, in
true cocoon style, implemented as XSLT pipelines on static or generated
XML content.
In the long term, I see the benefits of moving these to Lift templates,
but in a 0.9 version (as it were), it makes a fair amount of sense to
use the existing templates, with a lift snippet or view (or even a
wrapper function or hook) performing a final XSLT transform on the
generated XML.
I can see how to hook such a step into Lift's processing can be done,
but I also see that Lift has no native support for this (no surprise, as
Lift has a full templating system of its own). Before I set about doing
this by calling into Xerces and Xalan from Scala (should be easy
enough), is there any sample code or Scala API for XSLT transformations
already out there?
Thanks,
Fri, 2009-12-04, 17:47
#2
Re: XSLT?
Stepan Koltsov writes:
> BTW, what's wrong with Cocoon?
Nothing per se (I'm very fond of cocoon, and have been using it a long
time) -- but Lift adds a lot of stuff in terms of both session state and
UI handling which I don't have time to write, and Cocoon 3.0 is taking a
long time to come out, and will have only some of that from the current
roadmaps.
> ... and this question is offtopic here, Lift questions should go to
> Lift mailing lists.
Well, it's not really a Lift question -- I'm looking for advice on the
Scala side of this; once I have a Scala XSLT transform I'm happy with,
I'll worry about hooking that into Lift.
Fri, 2009-12-04, 18:17
#3
Re: XSLT?
On Fri, Dec 4, 2009 at 8:43 AM, Jim Wise <jwise@draga.com> wrote:
Stepan Koltsov <stepan.koltsov@gmail.com> writes:
> BTW, what's wrong with Cocoon?
Nothing per se (I'm very fond of cocoon, and have been using it a long
time) -- but Lift adds a lot of stuff in terms of both session state and
UI handling which I don't have time to write, and Cocoon 3.0 is taking a
long time to come out, and will have only some of that from the current
roadmaps.
> ... and this question is offtopic here, Lift questions should go to
> Lift mailing lists.
Well, it's not really a Lift question
We do like to hear about how others are using Lift... feel encouraged to post similar questions to the Lift list in the future.
Some time ago I made a web application, where scala code generated XML
that was lately transformed to HTML using XSLT. Without Lift.
There is nothing difficult there: you just transform Scala XML to JDK
DOM, and then apply XSL transformation.
I think this approach is better then Lift templates.
BTW, what's wrong with Cocoon?
... and this question is offtopic here, Lift questions should go to
Lift mailing lists.
S.
On Fri, Dec 4, 2009 at 19:24, Jim Wise wrote:
> I'm in the process of moving an application currently implemented in
> Java using Apache Cocoon to Scala and Liftweb. I've had a relatively
> easy time moving the `plumbing' of the app over -- sessions, users,
> dynamic content and so on -- but a lot of the app's presentation is, in
> true cocoon style, implemented as XSLT pipelines on static or generated
> XML content.
>
> In the long term, I see the benefits of moving these to Lift templates,
> but in a 0.9 version (as it were), it makes a fair amount of sense to
> use the existing templates, with a lift snippet or view (or even a
> wrapper function or hook) performing a final XSLT transform on the
> generated XML.
>
> I can see how to hook such a step into Lift's processing can be done,
> but I also see that Lift has no native support for this (no surprise, as
> Lift has a full templating system of its own). Before I set about doing
> this by calling into Xerces and Xalan from Scala (should be easy
> enough), is there any sample code or Scala API for XSLT transformations
> already out there?