cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Stevens <>
Subject RE: How to transform a subset of xml stream ?
Date Sat, 12 Jan 2008 01:11:11 GMT

> Date: Fri, 11 Jan 2008 11:34:50 +0100
> From:
> Ard Schrijvers a écrit :
>>> Hi,
>>> I have the following xml stream
>>> [example]
>>>     [A]...[/A]
>>>     [wfs:GetFeature]....[/wfs:GetFeature]
>>> [/example]
>>> I'd like to call my WFS transformer which make a call to a 
>>> WebFeatureService with [wfs:GetFeature] xml stream in 
>>> parameters, and keep [A/] tag in the response.
>>> th reponse should be :
>>> [example]
>>>        [A]...[/A]
>>>         [wfs:featureCollection/] xml response of WFS web 
>>> service [/example]
>>> How can i write my sitemap to do that ?
>>> Transform a subset of xml stream ?
>> I am a little confused what exactly you want. You want to fetch 
>> external xml and transform it and then embed this in the xml / sax 
>> events  you allready have, right? Is this not what the 
>> includetransformer does? 

Ard's not the only one confused.  You refer to "my WFS transformer", 
so I assumed it was one you'd already written, yet your later email
asks how you might go about writing one.  And you refer to the 
"WFS web service" which I took to mean a SOAP/REST based
web service such as you might call with the Web Service Proxy
Generator (
but from Ard's mail it sounds more like you just want to make 
an HTTP request to some URL and include the results in the pipeline?
In which case, as Ard suggested, the cinclude transformer ought
to be able to do this for you, even for a POST request (as documented
under "Including External XML (advanced)" at

> yes it is, but could includetransformer get all the xml node 
> [wfs:GetFeature] and send it to an url as post parameter, then get the 
> results back and put it back as xml sax event ?

You just need a suitable xsl transformer before it in the pipeline
to convert your wfs:GetFeature tag into the relevant

> using the following CInclude parameters ??

[xsl:template match="wfs:GetFeature"]

>     [cinclude:includexml ignoreErrors="true"]
>         [cinclude:src]http://myWFSserver/wfs[/cinclude:src]
>       [cinclude:configuration]
>         [cinclude:parameter]
>           [cinclude:name]method[/cinclude:name]
>           [cinclude:value]POST[/cinclude:value]
>         [/cinclude:parameter]
>       [/cinclude:configuration]
>       [cinclude:parameters]
>         [cinclude:parameter]
>           [cinclude:name]????[/cinclude:name]
>           [cinclude:value]

[xsl:copy-of select="."/] or [xsl:value-of select="."] depending whether you want to keep
the GetFeature tags or just send their contents.

> 	 [/cinclude:value]
>         [/cinclude:parameter]
>       [/cinclude:parameters]
>     [/cinclude:includexml]


> which name for the parameter in a httppost ?

Whatever name the URL you are calling expects for that 
parameter.  Doesn't matter if it's part of the URL in a GET
request or in the body for a POST request, it will still have
a name.  If you were calling it from an HTML FORM, what
name would the relevant INPUT field have?

> cinclude still available with cocoon2.2 ??

I've not used 2.2 myself, but I believe it's still in there.  It's 
included in the list of All Comonents on the web site, even
if it's not itself particularly well documented.

--  Open source Sudoku application

Free games, great prizes - get gaming at Gamesbox.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message