You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tammo van Lessen <cu...@taval.de> on 2001/11/28 17:40:46 UTC
Newbie: ELSE-Statement in sitemap?
Hi,
Is it possible to process an else-statement in the sitemap?
I need to check, if a sessionattribute is set and pass its value to the
xslt-transformer. if it is NOT set, i want to transform aswell, without the
parameter.
<map:match type="sessionattribute" pattern="*">
<map:parameter name="attribute-name" value="username"/>
<map:transform src="docs/blah.xsl" type="xslt">
<map:parameter name="username" value="{1}"/>
</map:transform>
</map:match>
ELSE
<map:transform src="docs/blah.xsl" type="xslt">
<map:parameter name="username" value="{1}"/>
</map:transform>
Or is it possible, to set a variable? Then I could use a selector...
Please help me!
Thanks!!!
Tammo
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Newbie: ELSE-Statement in sitemap?
Posted by Tammo van Lessen <cu...@taval.de>.
Hi!
It works! I forgot to include the <serialize/> statement into both blocks.
Thanks!!
cya
Tammo
| -----Ursprüngliche Nachricht-----
| Von: Nuno José Pires dos Santos [mailto:nsantos@electroplus.pt]
| Gesendet: Mittwoch, 28. November 2001 17:49
| An: cocoon-users@xml.apache.org
| Betreff: RE: Newbie: ELSE-Statement in sitemap?
|
|
| If you set a session attribute that doesn't exist it will probably
| default to null, so what's the point?
|
| If you really need it just use the session validate action like this
|
| <map:act type="session-validate">
| <map:parameter name="descriptor"
| value="context://descriptors/users.xml"/>
| <map:parameter name="validate" value="username"/>
|
| <!-- your code -->
| </map:act>
|
| <!-- your else code-->
|
| -----Mensagem original-----
| De: Tammo van Lessen [mailto:cusers-list@taval.de]
| Enviada: quarta-feira, 28 de Novembro de 2001 16:41
| Para: cocoon-users@xml.apache.org
| Assunto: Newbie: ELSE-Statement in sitemap?
|
| Hi,
|
| Is it possible to process an else-statement in the sitemap?
|
| I need to check, if a sessionattribute is set and pass its value to the
| xslt-transformer. if it is NOT set, i want to transform aswell, without
| the
| parameter.
|
| <map:match type="sessionattribute" pattern="*">
| <map:parameter name="attribute-name" value="username"/>
| <map:transform src="docs/blah.xsl" type="xslt">
| <map:parameter name="username" value="{1}"/>
| </map:transform>
| </map:match>
|
| ELSE
| <map:transform src="docs/blah.xsl" type="xslt">
| <map:parameter name="username" value="{1}"/>
| </map:transform>
|
| Or is it possible, to set a variable? Then I could use a selector...
|
| Please help me!
|
| Thanks!!!
| Tammo
|
|
| ---------------------------------------------------------------------
| Please check that your question has not already been answered in the
| FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
|
| To unsubscribe, e-mail: <co...@xml.apache.org>
| For additional commands, e-mail: <co...@xml.apache.org>
|
|
| ---------------------------------------------------------------------
| Please check that your question has not already been answered in the
| FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
|
| To unsubscribe, e-mail: <co...@xml.apache.org>
| For additional commands, e-mail: <co...@xml.apache.org>
|
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: Newbie: ELSE-Statement in sitemap?
Posted by Nuno José Pires dos Santos <ns...@electroplus.pt>.
If you set a session attribute that doesn't exist it will probably
default to null, so what's the point?
If you really need it just use the session validate action like this
<map:act type="session-validate">
<map:parameter name="descriptor"
value="context://descriptors/users.xml"/>
<map:parameter name="validate" value="username"/>
<!-- your code -->
</map:act>
<!-- your else code-->
-----Mensagem original-----
De: Tammo van Lessen [mailto:cusers-list@taval.de]
Enviada: quarta-feira, 28 de Novembro de 2001 16:41
Para: cocoon-users@xml.apache.org
Assunto: Newbie: ELSE-Statement in sitemap?
Hi,
Is it possible to process an else-statement in the sitemap?
I need to check, if a sessionattribute is set and pass its value to the
xslt-transformer. if it is NOT set, i want to transform aswell, without
the
parameter.
<map:match type="sessionattribute" pattern="*">
<map:parameter name="attribute-name" value="username"/>
<map:transform src="docs/blah.xsl" type="xslt">
<map:parameter name="username" value="{1}"/>
</map:transform>
</map:match>
ELSE
<map:transform src="docs/blah.xsl" type="xslt">
<map:parameter name="username" value="{1}"/>
</map:transform>
Or is it possible, to set a variable? Then I could use a selector...
Please help me!
Thanks!!!
Tammo
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>