Hi I've got the following in sitemap.xmap:

<map:match pattern="dins-facturacio">
  <map:generate src="docs/dins.xml"/>
  <map:transform src="stylesheets/dins.xsl">
    <map:parameter name="document" value="cocoon://
    <map:parameter name="usuari" value="{../ID}"/>
    <map:parameter name="nom" value="{../nom}"/>
    <map:parameter name="instruccions" value="{../i
  </map:transform>
  <map:transform type="xinclude"/>
  <map:transform src="stylesheets/facturacio-db.xsl">
    <map:parameter name="usuari" value="{../ID}"/>
  </map:transform>
  <map:transform type="sql">
    <map:parameter name="use-connection" value="cocoon"/>
  </map:transform>
  <map:transform src="stylesheets/facturacio.xsl">
    <map:parameter name="usuari" value="{../ID}"/>
    <map:parameter name="nom" value="{../nom}"/>
  </map:transform>
  <map:serialize/>
</map:match>

The first transform is needed (doesn't depend on me) and then I include
the xml file that shuld go inside the html generated by dins.xsl.
Then the xml file included by xinclude is has to be processed by sql
tranform and this result by facturacio.xsl (I had to do it that way
because a call to cocoon://facturacio.xml from dins.xsl didn't enable
facturacio-db.xsl to see the {../ID} value).

Well.. the problem is that the sql transform gives an error if inside
facturacio-db.xsl I put a matcher to copy all nodes that I don't have to
modify (to leave the html file as is). However, it works well if I take
the output after db-facturacio.xsl, save it as XML and create another pipe
like this one:

  <map:generate src="docs/result.xml"/>
  <map:transform type="sql">
    <map:parameter name="use-connection" value="cocoon"/>
  </map:transform>
  <map:transform src="stylesheets/facturacio.xsl">
    <map:parameter name="usuari" value="{../ID}"/>
    <map:parameter name="nom" value="{../nom}"/>
  </map:transform>
  <map:serialize/>

Any Ideas??

Thanks!


The error generated by sql transformer is:
-Message:
Could not read resource file:/var/lib/tomcat/webapps/usuaris/docs/dins.xml

-Description:
description org.apache.cocoon.ProcessingException: Could not read resource
file:/var/lib/tomcat/webapps/usuaris/docs/dins.xml:
java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.NullPointerException

-Sender:
sender org.apache.cocoon.servlet.CocoonServlet

-Stack Trace:

org.apache.cocoon.ProcessingException: Could not read resource
file:/var/lib/tomcat/webapps/usuaris/docs/dins.xml:
java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.NullPointerException
at
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:155)
at
org.apache.cocoon.components.pipeline.AbstractEventPipeline.process(AbstractEventPipeline.java:166)
at
org.apache.cocoon.components.pipeline.AbstractStreamPipeline.process(AbstractStreamPipeline.java:192)
at
org.apache.cocoon.www.sitemap_xmap.matchN102B9(/var/cache/tomcat/DEFAULT/usuaris/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:3142)
at
org.apache.cocoon.www.sitemap_xmap.process(/var/cache/tomcat/DEFAULT/usuaris/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:1632)
at
org.apache.cocoon.www.sitemap_xmap.process(/var/cache/tomcat/DEFAULT/usuaris/cocoon-files/org/apache/cocoon/www/sitemap_xmap.java:1516)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:222)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)
at org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154)
at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:998)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:484)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:432)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at
org.apache.tomcat.modules.server.Ajp13Interceptor.processConnection(Ajp13Interceptor.java:213)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:477)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:519)
at java.lang.Thread.run(Thread.java:484)

etc, etc....

-- 
Albert Cervera Areny
Dept. Informātica Sedifa, S.L.



---------------------------------------------------------------------
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