Re: Using ECS to generate an XSLT?

Lauren Bish <[email protected]> Mon, 10 Apr 2006 14:09:27 -0700
Newsgroups gmane.comp.jakarta.ecs.user
Message-ID <[email protected]>
On Apr 10, 2006, at 1:23 PM, robert burrell donkin wrote:

> On Mon, 2006-04-10 at 11:43 -0700, Lauren Bish wrote:
>> I have a need to do this, and I have used ECS to generate HTML
>> previously - but I find no XSL specific classes/tags in the ECS. For
>> my purposes I use the XSLT to transform XML from one schema to
>> another, not to generate HTML from XML.
>
> (just to check that i understand you correctly) you want to generate
> XSLT documents programmatically?
>

Yes. I am writing an adapter for a customer to read in their data,  
use Xalan and an XSLT to transform it into a format I can then read  
into existing objects with Castor, and then merge those into a  
database on a server. The transform is fairly simple, but some small  
portions of it need to be configurable, while others will remain  
static. I want to be able to have the customer only have to change  
one or two elements in an XML config file to have it work with a new  
set of elements within a known structure (specifically, the element  
names will change, but beyond that no structural changes). I don't  
want to have them have to muck with the XSLT document itself (they  
can if they want, but that will be unsupported). So I want to  
generate the XSLT programmatically. This is not a general solution,  
but neither is it a one-off quick and dirty solution either, it will  
be used for some time and would save money in the long time if it is  
configurable in this manner.

>> Any examples/suggestions?
>
> there was some experimental code from way back that generates ECS
> syntax's from schema's and DTD's. if you do want to create an ECS
> grammar for XSLT that might speed things up a bit. alternatively, you
> could investigate more modern generators (for example JaxMe or
> XmlBeans).

Thanks, but I am not looking for a data binding framework (unless I  
am not understanding how these would be used to generate XSL) - I  
just need to output XSL specific elements - even a subset would do  
for now. Except for having to deal with HTML output (which is not a  
requirement for my adapter - I output XML), I don't think it would be  
too hard for me to extend the ECS to construct XSL in the same way  
someone created the HTML output classes, but I wanted to make sure I  
wasn't reinventing the wheel or there wasn't some other reason this  
wasn't done (besides the problem of getting HTML output to work -  
which would seem to require mixing of HTML inside XSL, and XSL inside  
of HTML).