Ilya Izhovkin
Ilya Izhovkin

Reputation: 3455

Java code generator from XSLT

Is there any tool that can generate java code from XSLT?

UPD

I want to generate java source or byte code, which does the similar transformation, as the XSLT does. I want to run it on Android, so solution must be suitable for usage on mobile platform.

Upvotes: 2

Views: 1849

Answers (2)

Dimitre Novatchev
Dimitre Novatchev

Reputation: 243459

I want to generate java source or byte code, which does the similar transformation, as the XSLT does. I want to run it on Android, so solution must be suitable for usage on mobile platform.

Just take the open source version of Saxon (written entirely in Java).

Saxon 6.5.5 implements XSLT 1.0. Saxon 9.1.07 implements the basic version (not schema-aware) of XSLT 2.0.

Also, one could use the Java byte-code generated or even the Java source code generated.

Recently Michael Kay has been converting Saxon to Javascript, so we may expect soon to have Saxon-JS running on the client (browser) side as a de-facto standard client side XSLT 2.0 processor.

Upvotes: 1

David O'Meara
David O'Meara

Reputation: 3033

I have done it using XML files to define objects and then using XSLT to transform to beans, forms, struts classes, DB tables etc but in my mind it is a long way to go for about the same amount of effort as writing the code using cut and paste... Sadly it is commercial so I can't share it :( A bit long in the tooth but XDoclet is also useful for code generation.

Upvotes: 0

Related Questions