cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KOZLOV Roman <r-koz...@opencascade.com>
Subject Re: null pointer passed as base exception
Date Fri, 28 Jun 2002 07:38:17 GMT
Hello Leona,

Where do you define {1}, {3} and {4} in your pipeline?
IMO it should be like this:

    <map:match pattern="matrix">
      <map:generate src="gs.xml"/>
      <map:transform src="gs.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
          <map:parameter name="pagename" value="matrix"/>
          <map:parameter name="playerID" value="123"/>
      </map:transform>
      <map:transform src="default-html.xsl"/>
      <map:serialize type="html"/>
    </map:match>

Here you say to transformer to use request parameters by setting
"use-request-parameters" to true.
Then in your xsl you can get parameters' values by means of the following
top-level elements:
<xsl:param name="dealID"/>
<xsl:param name="matrixfile">default_value</xsl:param>
...
and then you can use them as variables, like "$dealID".

PS: It seems that in this case you need not lines with extra "pagename" and
"playerID" definition in your sitemap.

Best regards,
Roman

Leona Slepetis wrote:

> Hi All,
>
> I have part of  a pipeline that looks like this:
>
>     <map:match pattern="matrix">
>       <map:generate src="gs.xml"/>
>       <map:transform src="gs.xsl">
>         <map:parameter name="pagename" value="matrix"/>
>         <map:parameter name="dealID" value="{1}"/>
>         <map:parameter name="playerID" value="123"/>
>         <map:parameter name="matrixfile" value="{3}"/>
>         <map:parameter name="projectname" value="{4}"/>
>       </map:transform>
>       <map:transform src="default-html.xsl"/>
>       <map:serialize type="html"/>
>     </map:match>
>
> In gs.xml I have:
>
> <application>
>   <page name="matrix"/>
> <!-- some other stuff that doesn't matter in this example -->
> </application>
>
> In gs.xsl I have:
>
>   <xsl:template match="application">
>     <xsl:if test="not($pagename)">
>       <xsl:apply-templates select="page[@name='default']"/>
>     </xsl:if>
>     <xsl:if test="$pagename">
>       <xsl:apply-templates select="page[@name=$pagename]"/>
>     </xsl:if>
>   </xsl:template>
>
> And default-html.xsl has:
>
>   <xsl:template match="page">
>     <html>
>       <head>
>         <title>title</title>
>       </head>
>       <body>
>         <xsl:apply-templates/>
>       </body>
>     </html>
>   </xsl:template>
>
> I get to it by calling
> http://localhost:8080/GS/matrix?dealID=1001&playerID=&matrixfile=file:///D:/
> matrix.xml&projectname=new
>
> When I run it, the following error occurs:
> Could not read resource file:/D:/tomcat/webapps/GS/gs.xml
>
> org.apache.cocoon.ProcessingException: Could not read resource
> file:/D:/tomcat/webapps/GorillaStation/gs.xml: java.lang.RuntimeException:
> java.lang.IllegalArgumentException: Null pointer passed as base
>
> One thing I notice is that playerID is not set to the value '123'. Why is
> this?
> The other thing is that if I take out    <map:parameter name="pagename"
> value="matrix"/>  from the pipeline it works
> according to the default logic in <xsl:application>.
>
> There doesn't appear to be anything wrong with gs.xml; it was working under
> C1.
> Other pipeline segments using the parameter "pagename" work just fine, such
> as:
>
>     <map:match pattern="summary">
>       <map:generate src="gs.xml"/>
>       <map:transform src="gs.xsl">
>         <map:parameter name="pagename" value="summary"/>
>       </map:transform>
>       <map:transform src="default-html.xsl"/>
>       <map:serialize type="html"/>
>     </map:match>
>
> Can anyone give me a clue as to what is wrong?
>
> Thanks very much,
> Leona
>
> ---------------------------------------------------------------------
> 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