cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <robby.pelss...@ciber.com>
Subject RE: How to transform XML-URL-parameters a into a parse-able XML in a pipeline ?
Date Wed, 12 May 2010 12:11:09 GMT
Try this:


      <map:match pattern="foo">
        <map:generate src="request/request.jx" type="jx"/>
        <map:serialize type="xml"/>
      </map:match>


Request.jx
--------------
<?xml version="1.0" encoding="UTF-8"?>
<jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
  <Request>
    <Parameters>
      <jx:forEach var="parameterName" items="${cocoon.request.parameterNames}">
        <Parameter>
          <Name>${parameterName}</Name>
          <Value>${cocoon.request[parameterName]}</Value>
        </Parameter>
      </jx:forEach>
    </Parameters>
  </Request>
</jx:template>



http://localhost:8888/fase3/foo?filter1=<a><b/><c/></a>&filter2=<root><a>SomeText</a></root>


RESULT:
-------------
<Request>
  <Parameters>
    <Parameter>
      <Name>filter2</Name>
      <Value><root><a>SomeText</a></root></Value>
    </Parameter>
    <Parameter>
      <Name>filter1</Name>
      <Value><a><b/><c/></a></Value>
    </Parameter>
  </Parameters>
</Request>


-----Original Message-----
From: S├ębastien Geindre [mailto:sebastien.geindre@meteo.fr] 
Sent: Wednesday, May 12, 2010 1:49 PM
To: users@cocoon.apache.org
Subject: How to transform XML-URL-parameters a into a parse-able XML in a pipeline ?

Hi all,


What i need to do is to transform http GET request into XML parse-able 
with cocoon 2.2

an example :

the request : http://host/foo?filter=<a><b/><c/></a>

when i use <map:generate type="request">
i have :
<h:parameter name="filter">
<h:value>&lt;a&gt;&lt;b/&gt;&lt;c/&gt;&lt;/a&gt;</h:value>
</h:parameter>

h:value is not parse-able..

if i use <map:parameter name="xml" value="{request-param:filter}"/>
i have got the same thing...


any help ?

thanks!
S├ębastien



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


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


Mime
View raw message