You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Terray <te...@4dconcept.fr> on 2002/06/20 10:50:36 UTC

Cocoon bug ? XSLT transform before SQL transform

Hello all,

I want to submit a query through the SQL transformer, after a short 
transformation with XSLT. However, each time I do that, I get an error :
---------
Message : Could not read resource file:/C:/Program Files/Apache Tomcat 
4.0/webapps/cocoon-dev/sql/sql-page-test.xml
---------

The beginning of the Stack Trace is :
-----------
org.apache.cocoon.ProcessingException: Could not read resource 
file:/C:/Program Files/Apache Tomcat 
4.0/webapps/cocoon-dev/sql/sql-page-test.xml: java.lang.RuntimeException: 
java.lang.NullPointerException
         at 
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:155)
         at 
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:251)
----------

If I just do the XSLT transform, everything work fine, and if I take the 
result of this transformation and feed it directly to SQL transform, 
everything goes fine as well ! I just cannot have the two working together...

Here is my original XML (sql-page-text.xml) :
---------
<?xml version="1.0"?>

<page>

  <title>Hello</title>
  <content>
          <para>GEDI : Interrogation de la base</para>


          <test/>
  </content>
</page>
--------------

The XSL (param-sql.xsl) is :
--------------
<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                               xmlns:sql="http://apache.org/cocoon/SQL/2.0">
         <xsl:param name="name" select="'cn=paul'"/>
         <xsl:template match="*|@*|processing-instruction()|comment()">
                 <xsl:copy>
                         <xsl:apply-templates select="@*"/>
                         <xsl:apply-templates select="node()"/>
                 </xsl:copy>
         </xsl:template>

         <xsl:template match="test">
           <sql:execute-query>
            <sql:query>
              select * from langue
            </sql:query>
           </sql:execute-query>
         </xsl:template>
</xsl:stylesheet>
-----------

and my sitemap is :
-----------
<map:match pattern="bdgeditest.xml">
  <map:generate src="sql/sql-page-test.xml"/>
  <map:transform src="transforms/param-sql.xsl"/>
  <map:transform type="sql">
   <map:parameter name="use-connection" value="gedi_db"/>
  </map:transform>
  <map:serialize type="html"/>
</map:match>
----------

My config :
- Apache 2.0.36
- Cocoon 2.0.2-dev
- Tomcat 4.0.4 final

Thanks in advance.

--
Paul TERRAY - Documents Management Systems Engineer
email : terray@4dconcept.fr

---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


--
Paul TERRAY - Ingénieur Systèmes Documentaires
4Dconcept
Centre d'affaires - 22, rue Etienne de Jouy
78353 Jouy en Josas CEDEX
Tel. 01 34 58 70 70 - Fax. 01 39 46 06 90
email : terray@4dconcept.fr 


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Cocoon bug ? XSLT transform before SQL transform

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Paul Terray [mailto:terray@4dconcept.fr]
> 
> Hello all,

Paul,

You, as user of this list, should not only send questions, but also read
and answer on replies on your questions.

Please, read:
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102449556711953&w=2.


PS CC'ing you so you don't mess it.

Regards,
Vadim

 
> I want to submit a query through the SQL transformer, after a short
> transformation with XSLT. However, each time I do that, I get an error
:
> ---------
> Message : Could not read resource file:/C:/Program Files/Apache Tomcat
> 4.0/webapps/cocoon-dev/sql/sql-page-test.xml
> ---------
> 
> The beginning of the Stack Trace is :
> -----------
> org.apache.cocoon.ProcessingException: Could not read resource
> file:/C:/Program Files/Apache Tomcat
> 4.0/webapps/cocoon-dev/sql/sql-page-test.xml:
java.lang.RuntimeException:
> java.lang.NullPointerException
>          at
>
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:1
55)
>          at
>
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(Cachi
ngEven
> tPipeline.java:251)
> ----------
> 
> If I just do the XSLT transform, everything work fine, and if I take
the
> result of this transformation and feed it directly to SQL transform,
> everything goes fine as well ! I just cannot have the two working
together...
> 
> Here is my original XML (sql-page-text.xml) :
> ---------
> <?xml version="1.0"?>
> 
> <page>
> 
>   <title>Hello</title>
>   <content>
>           <para>GEDI : Interrogation de la base</para>
> 
> 
>           <test/>
>   </content>
> </page>
> --------------
> 
> The XSL (param-sql.xsl) is :
> --------------
> <?xml version="1.0" encoding="utf-8"?>
> 
> <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
xmlns:sql="http://apache.org/cocoon/SQL/2.0">
>          <xsl:param name="name" select="'cn=paul'"/>
>          <xsl:template
match="*|@*|processing-instruction()|comment()">
>                  <xsl:copy>
>                          <xsl:apply-templates select="@*"/>
>                          <xsl:apply-templates select="node()"/>
>                  </xsl:copy>
>          </xsl:template>
> 
>          <xsl:template match="test">
>            <sql:execute-query>
>             <sql:query>
>               select * from langue
>             </sql:query>
>            </sql:execute-query>
>          </xsl:template>
> </xsl:stylesheet>
> -----------
> 
> and my sitemap is :
> -----------
> <map:match pattern="bdgeditest.xml">
>   <map:generate src="sql/sql-page-test.xml"/>
>   <map:transform src="transforms/param-sql.xsl"/>
>   <map:transform type="sql">
>    <map:parameter name="use-connection" value="gedi_db"/>
>   </map:transform>
>   <map:serialize type="html"/>
> </map:match>
> ----------
> 
> My config :
> - Apache 2.0.36
> - Cocoon 2.0.2-dev
> - Tomcat 4.0.4 final
> 
> Thanks in advance.
> 
> --
> Paul TERRAY - Documents Management Systems Engineer
> email : terray@4dconcept.fr


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>