cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <>
Subject Re: Dynamic transformation from value in xml document
Date Thu, 01 May 2003 11:54:29 GMT

Can you explain what are you trying to do. I mean the target not the
approach you are trying to use. The approach is clear below.

Why you need an attribute or element inside an XML file to define the
stylesheet you need to use?

Maybe there is another approach more friendly that will have the same
target as you need.

But is you still want to continue with this approach your can use XPointer
inside ONLY ONE XSL file with all the posible configurations and after
reading the attribute or element you can then define what pattern apply.
This is just another approach to target the same....

Best Regards,

Antonio Gallardo

Joerg Heinicke dijo:
> Hello Corey,
> the action is the correct solution, if you do it the way you want. But
> in my opinion already the way is wrong! The XML should not have
> influence on the selection of the XSLT. This is the old behaviour in
> Cocoon 1 where the XSLT processing was driven by a processing
> instruction in the XML.
> Joerg
> Corey Keith wrote:
>> A newbie question here so I may be overlooking the obvious but
>> anyway...
>>   I've got a pretty simple pipeline but I'd like to use an attribute
>> value from my generated document to determine the transformation xslt.
>>  For something like this:
>> <map:match pattern="*">
>>   <map:generate src="mets/{1}.xml"/>
>>   <map:transform src="xslt/{a value from {1}.xml}.xsl">
>>     <map:parameter name="use-request-parameters" value="true"/>
>>   </map:transform>
>> </map:match>
>> So for example if the request was
>> http://localhost/cocoon/12345
>> and 12345.xml had an attribute on the root node called type with the
>> value of "book":
>> <map:match pattern="*">
>>   <map:generate src="mets/12345.xml"/>
>>   <map:transform src="xslt/book.xsl">
>>     <map:parameter name="use-request-parameters" value="true"/>
>>   </map:transform>
>> </map:match>
>> I was thinking about writing an action which I would pass the source
>> document location and then sax parse to obtain my value and return
>> that to the sitemap for later processing.  Does this sound reasonable?
>>  It seems as if there should be an easier solution.
>> Thanks,
>> Corey
> --------------------------------------------------------------------- To
> unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message