Using request parameters values in @href of a processor's input

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using request parameters values in @href of a processor's input

Edgard Pineda-2
Hi everyone,
I'm trying to use the values of some request parameters, to generate a
href path to a xml instance and then transform it with a specific .xsl
file.
I'm using the following in a .xpl:
...
  <p:processor name="oxf:request">
    <p:input name="config">
      <config>
        <include>/request/parameters</include>
      </config>
    </p:input>
    <p:output name="data" id="request-info"/>
  </p:processor>

  <!-- XSLT transformation -->
  <p:processor name="oxf:xslt">
    <p:input name="config" href="file:///some/path/transf.xsl"/>
    <p:input name="data"
href="oxf:doc(concat('file:///some/other/path/',
#request-info#xpointer(string(/request/parameters/parameter[name='path']/value)),
'/', #request-info#xpointer(string(/request/parameters/parameter[name='filename']/value))
))"/>
    <p:output name="data" id="response"/>
  </p:processor>

  <!-- Generate a response -->
  <p:processor name="oxf:xml-serializer">
    <p:input name="data" href="#response"/>
    <p:input name="config">
      <config/>
    </p:input>
  </p:processor>

But I got the following error message:
Can't parse ", #request-info#xpointer(string(/request/parameters/parameter[name='path']/value)),
'/', #request-info#xpointer(string(/request/parameters/parameter[name='name']/value))
)})" in href

What I'm doing wrong? is there a better way?

Edgard.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Using request parameters values in @href of a processor's input

Alessandro  Vernet
Administrator
On 10/28/06, Edgard Pineda <[hidden email]> wrote:
>     <p:input name="data"
> href="oxf:doc(concat('file:///some/other/path/',
> #request-info#xpointer(string(/request/parameters/parameter[name='path']/value)),
> '/', #request-info#xpointer(string(/request/parameters/parameter[name='filename']/value))
> ))"/>

Hi Edgard,

You can't use 'oxf:doc' in an 'href' expression in XPL. Instead, you
need to use a couple of processors:

1. XSLT to create a config for the URL generator
2. The URL generator which takes the config and returs the content of
the file. The output of this step will be piped in your XSLT
transformation (which runs file:///some/path/transf.xsl).

You will find more about the URL generator on:
http://www.orbeon.com/ops/doc/processors-generators-url

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet