You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by fadi qutaishat <fa...@yahoo.com> on 2005/04/04 12:22:03 UTC

Please could some one advise me on this!

Hi all,

I might be asking a very basic question but I really have tried the things out before posting this question.

I want to create a cocoon session which basically loads the XML data from MySQL  so I have done the following:

 

I have created myfirstsession1.xml which contains

 

<resource xmlns:session="http://apache.org/cocoon/session/1.0"> <session:createcontext name="dbtrackdemo" load="cocoon://load-from-db" save="cocoon://save-to-db"/>

  <!-- build context data --> 

  <context>

  <loadxml context="dbtrackdemo"/> 

  </context>

  </resource> 

 

Then I have defined the load-from-db (which works fine alone) and mydbsession resources in the sitemap 

 

<map:pipeline>

<map:match pattern="load-from-db">

<map:generate src="sql-test/sqlexample.xml"/>

 <map:transform type="sql">  

 <map:parameter name="use-connection" value="newdb"/>

   </map:transform>

     <map:serialize type="xml"/>

    </map:match>

</map:pipeline>

 

<map:pipeline>

<map:match pattern="mydbsession">

<map:generate src="training/myfirstsession1.xml"/>

<map:transform type="session"/>

<map:serialize type="xml"/>

</map:match>

</map:pipeline>

 

So when I request the mydbsession resource I get (nothing):

 

<?xml version="1.0" encoding="ISO-8859-1" ?> 

<resource xmlns:session="http://apache.org/cocoon/session/1.0">

<!--  build context data --> 

<context>

<loadxml context="dbtrackdemo" /> 

 </context>

 </resource>

 

I am using Cocoon version 2.1.6

I am sure that I am missing or putting things in the wrong place or order. 

Any help or hints would be appreciated. 

Fadi



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Please could some one advise me on this!

Posted by Joachim Breitsprecher <jb...@dserv.net>.
Hi Fadi,

fadi qutaishat wrote:
> So when I request the mydbsession resource I get (nothing):
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <resource xmlns:session="http://apache.org/cocoon/session/1.0">
> <!--  build context data -->
> <context>
> <loadxml context="dbtrackdemo" />
>  </context>
>  </resource>

It looks to me as if you forgot to add the session: namespace to your 
loadxml element. Try replacing

<loadxml context="dbtrackdemo" />

with:

<session:loadxml context="dbtrackdemo" />


HTH,

Joachim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org