------------------
-- 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
[EMAIL PROTECTED]




 > -----Original Message-----
 > From: Christian Haul [mailto:[EMAIL PROTECTED]] 
 > Sent: mardi 9 juillet 2002 18:36
 > To: [EMAIL PROTECTED]
 > 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
 > [EMAIL PROTECTED]
 >     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:     <[EMAIL PROTECTED]>
 > For additional commands, e-mail:   <[EMAIL PROTECTED]>
 > 
 > 

---------------------------------------------------------------------
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:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to