cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Balthazar" <...@emakina.com>
Subject SUMMARY: dynamic src for <map:generate>
Date Wed, 10 Jul 2002 08:32:36 GMT
------------------
-- the question --
------------------

what can i do if i want to have a source that
is dynamicly generated for the "<map:generate src="xxx"/>"
tag in the sitemap.xmap file?
i want the "src" attribute to be defined depending on the
link the user click on.
(e.g. :
href="http://localhost:8080/cocoon/preview.html?page=/content/xml01.xml"
)

------------------
-- the solution --
------------------

<map:match pattern="tba/*">
	<map:act type="request">
		<map:parameter name="parameters" value="true"/>
		<map:generate src="{page}"/>
		<map:transform src="docs/samples/tba/redirect.xsl"/>
		<map:serialize type="html"/>
	</map:act>
</map:match>

adding this tag "<map:act type="request">" and this tag
"<map:parameter name="parameters" value="true"/>" makes it
possible to get the "page" request attribute.
then, you can define the "src" by using the "page" attribute
like this "<map:generate src="{page}"/>".

it works fine for me.
thank the list and christian haul for the quick answer.

thomas balthazar
tba@emakina.com




 > -----Original Message-----
 > From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de] 
 > Sent: mardi 9 juillet 2002 18:36
 > To: cocoon-users@xml.apache.org
 > Subject: Re: dynamic src for <map:generate>
 > 
 > 
 > Two solutions (depending on your version):
 > 
 > a) RequestParamAction (2.0.x + 2.1)
 > 
 >  <map:match pattern="tba/*">
 >     <map:act type="request">
 > 	  <map:parameter name="parameters" value="true"/>
 > 	  <map:generate src="{page}"/>
 >  	  <map:transform src="docs/samples/tba/redirect.xsl"/>
 >  	  <map:serialize type="html"/>
 >     </map:act>
 >     <!-- else ? -->
 >  </map:match>
 > 
 > b) InputModules (2.1)
 > 
 >  <map:match pattern="tba/*">
 >  	<map:generate src="{request:page}"/>
 >  	<map:transform src="docs/samples/tba/redirect.xsl"/>
 >  	<map:serialize type="html"/>
 >  </map:match>
 > 
 > You might want to use ResourceExistsAction to check whether 
 > the provided page exists.
 > 
 > 	Chris.
 > 
 > Please follow up summarizing your problem and which 
 > suggested solution / information worked for you when you 
 > consider your problem solved. Add "SUMMARY: " to the subject 
 > line. This will make FAQ generation and searching the list 
 > easier. In addition, it makes helping you more fun. Thank you.
 > 
 > -- 
 > C h r i s t i a n       H a u l
 > haul@informatik.tu-darmstadt.de
 >     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
 > 
 > 
 > ---------------------------------------------------------------------
 > Please check that your question  has not already been answered in the
 > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
 > 
 > To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
 > For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
 > 
 > 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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