cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Claude Moissinac" <moissi...@enst.fr>
Subject Getting a parameter from the header or from a dynamic XML document
Date Fri, 24 Mar 2006 16:54:18 GMT
I'm trying to get an information from the HTTP header

I have tried with the Request Generator, something like
      <map:match pattern="request.xml">
        <map:generate type="request">
		    <map:parameter name="generate-attributes" value="true"/>
        </map:generate>
	    <map:serialize type="xml"/>
      </map:match>

I get something like
<?xml version="1.0" encoding="ISO-8859-1"?>
<h:request xmlns:h="http://apache.org/cocoon/request/2.0"
target="/filtres/req.svg" sitemap="req.svg" source="">
<h:requestHeaders>
<h:header name="host">localhost:8282</h:header>
<h:header name="user-agent">GPAC 0.4.1-DEV</h:header><h:header
name="accept">*/*</h:header>
<h:header name="terminal">Nokia3650</h:header><h:header
...
And  extract the value I need from request.xml. But as I need only one
value from the header, I'm searching another solution. And more, as I
want to give this value as a parameter for an XSL transformation or to
use this value for a selector, extractiong the value from an XML file
is not easy.

I've tried to use request.xml as the source of a XMLFileModule, but it
seems to be not possible to address such a dynamic xml file from the
XMLFileModule.

I heve tried with the Request Module
        <map:transform src="text2svg.xsl">
          <map:parameter name="terminal"    value="{request:terminal}"/>
...
So, I try to use the 'terminal' value present in my request as a
parameter of my transformation. But {request:terminal} seems to be
empty.

So, I'm searching a good way to extract a value from the header or to
use a value extracted from a dynamically created xml document as a
parameter for a pipeline.


Thank's in adavance

--
--
Jean-Claude Moissinac
Department of Computer Science and Networks
ENST Paris
FRANCE

E-mail: moissinac@enst.fr
Tel: (+33) 1.45.81.80.88
Fax: (+33) 1.45.81.71.58

http://shadok.enst.fr/jcm

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


Mime
View raw message