You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Artur Matos <am...@yahoo.com> on 2002/02/25 15:54:43 UTC

How to pass parameters to stylesheets via sitemap in offline mode?

Hi,

Can someone tell me if this is right? If I specify
a parameter to a transformer in the sitemap,
for example like this:

...

map:match pattern="**.html">
     <map:generate src="docs/{1}.xml"/>
     <map:transform src="stylesheets/ipms.xsl">
      <map:parameter name="fic" value="true" />
     <map:serialize/>
</map:match>

...

I should had a XSL variable named "fic" with
the specified value, available
in my stylesheet, right? Unfortunely, when I try
to generate the file in offline mode, an exception
is thrown saying that the XSL variable is not 
defined in the stylesheet.

As I had not tried this in normal servlet mode, can
someone tell me if this is the right way to create
XSL variables via sitemap? Or if it is not, what
is the correct way then? I want to supply to my
stylesheets a XSL variable with the name of
the current file being processed. Is that possible?

Thanks in advance,
Best regards,

Artur Matos

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

---------------------------------------------------------------------
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: How to pass parameters to stylesheets via sitemap in offline mode?

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Artur Matos [mailto:am78pt@yahoo.com]
> 
> 
> Hi,
> 
> Can someone tell me if this is right? If I specify
> a parameter to a transformer in the sitemap,
> for example like this:
> 
> ...
 
<map:match pattern="**.html">
  <map:generate src="docs/{1}.xml"/>
  <map:transform src="stylesheets/ipms.xsl">
    <map:parameter name="fic" value="true" />
    <map:parameter name="file" value="docs/{1}.xml" />
  </map:transform>
  <map:serialize/>
</map:match>

This should work both in servlet and in offline modes. Second parameter
is the currently processed file.


Parameters *must* be declared in the XSL file (stylesheets/ipms.xsl):

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:param name="fic">false</xsl:param> <!-- this is default value -->
  <xsl:param name="file">nofile.xml</xsl:param>

  ...
</xsl:stylesheet>


Real values to these parameters will be assigned from the sitemap,
overwriting defaults.

Regards,
Vadim


> ...
> 
> I should had a XSL variable named "fic" with
> the specified value, available
> in my stylesheet, right? Unfortunely, when I try
> to generate the file in offline mode, an exception
> is thrown saying that the XSL variable is not
> defined in the stylesheet.
> 
> As I had not tried this in normal servlet mode, can
> someone tell me if this is the right way to create
> XSL variables via sitemap? Or if it is not, what
> is the correct way then? I want to supply to my
> stylesheets a XSL variable with the name of
> the current file being processed. Is that possible?
> 
> Thanks in advance,
> Best regards,
> 
> Artur Matos


---------------------------------------------------------------------
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: How to pass parameters to stylesheets via sitemap in offline mode?

Posted by Artur Matos <am...@yahoo.com>.
Ok, that was the missing part. Thank you for the help.

Best regards,

Artur.

--- Luca Morandini <lu...@tin.it> wrote:
> Artur,
> 
> have you included <xsl:param name="fic"/> as a top
> element in your
> stylesheet ?
> 
> Best regards,
> 
> 
> ---------------------------------------------
>                Luca Morandini
>                GIS Consultant
>               lmorandini@ieee.org
> http://utenti.tripod.it/lmorandini/index.html
> ---------------------------------------------
> 
> 
> > -----Original Message-----
> > From: Artur Matos [mailto:am78pt@yahoo.com]
> > Sent: Monday, February 25, 2002 3:55 PM
> > To: cocoon-users@xml.apache.org
> > Subject: How to pass parameters to stylesheets via
> sitemap in offline
> > mode?
> >
> >
> >
> > Hi,
> >
> > Can someone tell me if this is right? If I specify
> > a parameter to a transformer in the sitemap,
> > for example like this:
> >
> > ...
> >
> > map:match pattern="**.html">
> >      <map:generate src="docs/{1}.xml"/>
> >      <map:transform src="stylesheets/ipms.xsl">
> >       <map:parameter name="fic" value="true" />
> >      <map:serialize/>
> > </map:match>
> >
> > ...
> >
> > I should had a XSL variable named "fic" with
> > the specified value, available
> > in my stylesheet, right? Unfortunely, when I try
> > to generate the file in offline mode, an exception
> > is thrown saying that the XSL variable is not
> > defined in the stylesheet.
> >
> > As I had not tried this in normal servlet mode,
> can
> > someone tell me if this is the right way to create
> > XSL variables via sitemap? Or if it is not, what
> > is the correct way then? I want to supply to my
> > stylesheets a XSL variable with the name of
> > the current file being processed. Is that
> possible?
> >
> > Thanks in advance,
> > Best regards,
> >
> > Artur Matos
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Sports - Coverage of the 2002 Olympic Games
> > http://sports.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > 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>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

---------------------------------------------------------------------
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: How to pass parameters to stylesheets via sitemap in offline mode?

Posted by Luca Morandini <lu...@tin.it>.
Artur,

have you included <xsl:param name="fic"/> as a top element in your
stylesheet ?

Best regards,


---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: Artur Matos [mailto:am78pt@yahoo.com]
> Sent: Monday, February 25, 2002 3:55 PM
> To: cocoon-users@xml.apache.org
> Subject: How to pass parameters to stylesheets via sitemap in offline
> mode?
>
>
>
> Hi,
>
> Can someone tell me if this is right? If I specify
> a parameter to a transformer in the sitemap,
> for example like this:
>
> ...
>
> map:match pattern="**.html">
>      <map:generate src="docs/{1}.xml"/>
>      <map:transform src="stylesheets/ipms.xsl">
>       <map:parameter name="fic" value="true" />
>      <map:serialize/>
> </map:match>
>
> ...
>
> I should had a XSL variable named "fic" with
> the specified value, available
> in my stylesheet, right? Unfortunely, when I try
> to generate the file in offline mode, an exception
> is thrown saying that the XSL variable is not
> defined in the stylesheet.
>
> As I had not tried this in normal servlet mode, can
> someone tell me if this is the right way to create
> XSL variables via sitemap? Or if it is not, what
> is the correct way then? I want to supply to my
> stylesheets a XSL variable with the name of
> the current file being processed. Is that possible?
>
> Thanks in advance,
> Best regards,
>
> Artur Matos
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
>
> ---------------------------------------------------------------------
> 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>