You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ecs-user@jakarta.apache.org by Lauren Bish <la...@developerdude.org> on 2006/04/10 20:43:15 UTC

Using ECS to generate an XSLT?

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.

Any examples/suggestions?

Should I just extend the XML classes?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-user-help@jakarta.apache.org


Re: Using ECS to generate an XSLT?

Posted by Lauren Bish <la...@developerdude.org>.
On Apr 10, 2006, at 2:48 PM, robert burrell donkin wrote:

>
> (sounds like your plan is a good match to your problem so this is  
> just a
> FYI)
>
> binding the XSLT specification gives you a way to generate XSL
> documents. the old, experimental code generated ECS bound to a  
> schema or
> DTD in a similar fashion.

Okay. I thought that was maybe the way you were going (if I  
understand what you are saying correctly - generate code from the  
w3.org XSL spec). I was just looking at the spec and thinking that -  
but I think it is a bit beyond me to do that at this point - I  
vaguely grok XML/XSL/etc., much less language grammars not being a  
CompSci person (I am just a lowly Code Monkey).

Anyway, it just occurred to me that my XSL is so simple and mostly  
static, that I can use another XSLT to generate it from the XML  
config file. I only need to be able to change two small portions of  
it; one element needs it's name changeable, and one set of elements/ 
transforms need to be added for each element in the config file. The  
transforms are the same for each element so I can just do a for-each  
on each one. I am sure there is a yet more elegant way to do it, but  
this will work well enough and it won't be reused except by the  
customer.

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-user-help@jakarta.apache.org


Re: Using ECS to generate an XSLT?

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On Mon, 2006-04-10 at 14:09 -0700, Lauren Bish wrote:
> On Apr 10, 2006, at 1:23 PM, robert burrell donkin wrote:
> 
> > On Mon, 2006-04-10 at 11:43 -0700, Lauren Bish wrote:

<snip>

> >> 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)

(sounds like your plan is a good match to your problem so this is just a
FYI)

binding the XSLT specification gives you a way to generate XSL
documents. the old, experimental code generated ECS bound to a schema or
DTD in a similar fashion. 

>  - 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).

i can't think of any reason why this hasn't been done and i agree that
it shouldn't be too hard to do. so hope this answers your question :)

- robert



---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-user-help@jakarta.apache.org


Re: Using ECS to generate an XSLT?

Posted by Lauren Bish <la...@developerdude.org>.
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).


---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-user-help@jakarta.apache.org


Re: Using ECS to generate an XSLT?

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
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?

> 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).

- robert



---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-user-help@jakarta.apache.org