cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Corey Keith" <cke...@loc.gov>
Subject Dynamic transformation from value in xml document
Date Thu, 01 May 2003 02:57:02 GMT
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: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message