You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matthieu Richard-Molard <ma...@pasteur.fr> on 2004/06/30 15:47:19 UTC

pipeline to read an xml file from an xsp

Hi!

I'm trying to write a pipeline in order to get data from an XML to XSP:

I specified sql requests in xml
  and i want the user to choose between them  through an XSP page

Perhaps I could hard-code the file access in Java but that would be 
cheating ...
There must be some other, pure Cocoon way to do it :
I must use the sitemap!

Could that be possible through content aggregation or something like 
that?



Many thanks in advance for any tip or piece of information.


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


Re: pipeline to read an xml file from an xsp

Posted by Joerg Heinicke <jo...@gmx.de>.
On 05.07.2004 11:38, Matthieu Richard-Molard wrote:

> 
> Hello!
> 
> I tried this code snippet,
>  but it  just gave me the uri instead of the source
> 
> cocoon:/view-source?filename=.xsp
> 
> I think my pipeline is wrong:
> 
> 
>  <map:match pattern="req1">
>       <map:generate src="req1.xsp" />

Missing: type="serverpages", otherwise you read the XSP just as XML.

Joerg

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


Re: pipeline to read an xml file from an xsp

Posted by Matthieu Richard-Molard <ma...@pasteur.fr>.
Hello!

I tried this code snippet,
  but it  just gave me the uri instead of the source

cocoon:/view-source?filename=.xsp

I think my pipeline is wrong:


  <map:match pattern="req1">
       <map:generate src="req1.xsp" />
        <map:transform src="../../../stylesheets/dynamic-page2html.xsl"/>
        <map:serialize/>
    </map:match>

Could you give me a hint?

Many thanks in advance.

Matt

Le 1 juil. 04, à 20:03, Joerg Heinicke a écrit :

> On 01.07.2004 15:47, Matthieu Richard-Molard wrote:
>
>>>> I'm trying to write a pipeline in order to get data from an XML to  
>>>> XSP:
>>>> I specified sql requests in xml
>>>>  and i want the user to choose between them  through an XSP page
>>>> Perhaps I could hard-code the file access in Java but that would be 
>>>>  cheating ...
>>>> There must be some other, pure Cocoon way to do it :
>>>> I must use the sitemap!
>>>> Could that be possible through content aggregation or something 
>>>> like  that?
>>>> Many thanks in advance for any tip or piece of information.
>>>
>>> This means you want to get access from the XSP to the XML file 
>>> having  stored the sql requests in XML? Maybe like in  
>>> http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/xsp/samples/ 
>>> java/resolver.xsp?rev=1.3&view=markup sample?
>> That can help,
>>  but i don't want to display the source XML on the page ;
>> instead I want to parse it,  in order to display :
>
> Of course not, the sample shows both. The first one includes the uri 
> unparsed as text, the second one as is. So
>
> <util:include-source>
>   <util:param name="uri">sqlrequests.xml</util:param>
> </util:include-source>
>
> should include the XML of sqlrequests.xml in your XSP and you can 
> preprocess it later on using a stylesheet.
>
> Joerg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

Re: pipeline to read an xml file from an xsp

Posted by Joerg Heinicke <jo...@gmx.de>.
On 01.07.2004 15:47, Matthieu Richard-Molard wrote:

>>> I'm trying to write a pipeline in order to get data from an XML to  XSP:
>>> I specified sql requests in xml
>>>  and i want the user to choose between them  through an XSP page
>>> Perhaps I could hard-code the file access in Java but that would be  
>>> cheating ...
>>> There must be some other, pure Cocoon way to do it :
>>> I must use the sitemap!
>>> Could that be possible through content aggregation or something like  
>>> that?
>>> Many thanks in advance for any tip or piece of information.
>>
>> This means you want to get access from the XSP to the XML file having  
>> stored the sql requests in XML? Maybe like in  
>> http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/xsp/samples/ 
>> java/resolver.xsp?rev=1.3&view=markup sample?
> 
> That can help,
>  but i don't want to display the source XML on the page ;
> instead I want to parse it,  in order to display :

Of course not, the sample shows both. The first one includes the uri 
unparsed as text, the second one as is. So

<util:include-source>
   <util:param name="uri">sqlrequests.xml</util:param>
</util:include-source>

should include the XML of sqlrequests.xml in your XSP and you can 
preprocess it later on using a stylesheet.

Joerg

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


Re: pipeline to read an xml file from an xsp

Posted by Matthieu Richard-Molard <ma...@pasteur.fr>.
Hello!

Thanks for your answer.

Le 1 juil. 04, à 00:20, Joerg Heinicke a écrit :

> On 30.06.2004 15:47, Matthieu Richard-Molard wrote:
>
>> I'm trying to write a pipeline in order to get data from an XML to  
>> XSP:
>> I specified sql requests in xml
>>  and i want the user to choose between them  through an XSP page
>> Perhaps I could hard-code the file access in Java but that would be  
>> cheating ...
>> There must be some other, pure Cocoon way to do it :
>> I must use the sitemap!
>> Could that be possible through content aggregation or something like  
>> that?
>> Many thanks in advance for any tip or piece of information.
>
> This means you want to get access from the XSP to the XML file having  
> stored the sql requests in XML? Maybe like in  
> http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/xsp/samples/ 
> java/resolver.xsp?rev=1.3&view=markup sample?
>
> Joerg

That can help,
  but i don't want to display the source XML on the page ;
instead I want to parse it,  in order to display :

- the list of the request names, so that the user can choose between  
them
- the parameters to fill for the chosen request

Is it possible in Cocoon with a special pipeline (or logicsheet)?

Many thanks


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


Re: pipeline to read an xml file from an xsp

Posted by Joerg Heinicke <jo...@gmx.de>.
On 30.06.2004 15:47, Matthieu Richard-Molard wrote:

> I'm trying to write a pipeline in order to get data from an XML to XSP:
> 
> I specified sql requests in xml
>  and i want the user to choose between them  through an XSP page
> 
> Perhaps I could hard-code the file access in Java but that would be 
> cheating ...
> There must be some other, pure Cocoon way to do it :
> I must use the sitemap!
> 
> Could that be possible through content aggregation or something like that?
> 
> Many thanks in advance for any tip or piece of information.

This means you want to get access from the XSP to the XML file having 
stored the sql requests in XML? Maybe like in 
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/xsp/samples/java/resolver.xsp?rev=1.3&view=markup 
sample?

Joerg

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