[Yanel-dev] simple problem hard solution

Josias Thöny josias.thoeny at wyona.com
Tue Jan 15 09:29:29 CET 2008


Michael Wechner wrote:
> Evaldas Taroza wrote:
> 
>> Hi,
>> I created a resource type which extends the BasicXMLResource. I want 
>> with this resource to:
>> 1. Aggregate several XMLs into one document (a couple of simple ones 
>> and the sitetree)
>> 2. Apply a transformation and return it as a view
>>
>> So I tried the most natural solution: I put into the resource 
>> configuration two XSLTs, one with xincludes another with 
>> transformations. Didn't work, XIncludes are resolved last.
>>
>> All the other configurations that I can think of are not very natural...
>>
>> Maybe anyone can think of a reasonable solution?
> 
> 
> either do your own custom resource or aggregate the content before you 
> send it through the XSLTs by overwriting the getContent... method of the 
> BasicXMLResource

As an alternative you could try what you suggested earlier, to set the 
URIResolver on the transformer, so you could include xml documents 
during the xslt transformation using document().
You would have to patch BasicXMLResource or add this to your own resource.

I cannot think of any other easy solutions right now.
If we want to make the whole pipeline configurable, it would be a lot of 
work.

josias

> 
> Of course it would be nice to have something like a "Cocoon Resource" 
> where one could configure such stuff, but I am afraid of other drawbacks 
> then.
> 
> But I understand we need to come up with a simple solution which would 
> covering the most commong uses and for the rest one can do custom 
> resources. It's about finding the balance ;-)
> 
> Cheers
> 
> Michi
> 
>>
>> Evaldas
>> _______________________________________________
>> Yanel-development mailing list
>> Yanel-development at wyona.com
>> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
> 
> 
> 



More information about the Yanel-development mailing list