Probleme : url-generator or http-serializer

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

Probleme : url-generator or http-serializer

Wang Yan
Hi, I've a problem, could you give me a hand ?

Assume I have this code  below :

<p:processor name="oxf:url-generator" xmlns:p="http://www.orbeon.com/oxf/pipeline">
        <p:input name="config">
            <config>
                 <url>file.jpg</url>
                  <content-type>image/jpeg</content-type>
                <force-content-type>true</force-content-type>
            </config>
        </p:in put>
        <p:output name="data" id="image-data"/>
    </p:processor>

Assume now file.jpg and image/jpeg are data stored in the form (i.e : p:input name="data" href="#instance") :

How can I do to obtain something like this ? (the example below is wrong) :

<p:processor name="oxf:url-generator" xmlns:p="http://www.orbeon.com/oxf/pipeline">
        <p:input name="data" href="#instance"/>
        <p:input name="config">
            <config>
            &nb sp;    <url><xsl:value-of select="/form/document/url"/></url>
                  <content-type><xsl:value-of select="/form/document/content-type"/></content-type>
                <force-content-type>true</force-content-type>
            </config>
        </p:input>
        <p:output name="data" id="image-data"/>
    </p:processor>

In other word, the data changes with respect to the value in the form instance .

Thanks in advance !


-----------------------------------------------------
Romandie Annonces : http://annonces.romandie.com
Petites annonces 100% gratuites entre romands
-----------------------------------------------------




--
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: Probleme : url-generator or http-serializer

Hank Ratzesberger

Hi Wang,

The examples all seem complex at first, but there
are probably snippets there for what you want to do.

You can do all kinds of things in the declarative/scripted language
of XML and its various extensions within the pipeline language.
When you want to insert/alter/produce some XML, you probably want
to use XSLT (or XUpdate).  Using the xslt processor, you can create
your <config> element (untested example):

<p:processor name="oxf:xslt" >
  <p:input name="data" href="#instance"/>
  <p:config>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="/">
        <config xmlns="">
          <url><xsl:value-of select="/form/document/url"/></url>
          <content-type><xsl:value-of select="/form/document/content-type"/></content-type>
          <force-content-type>true</force-content-type>
        </config>
      </xsl:template>
    </xsl:stylesheet>
  </p:config>
  <p:output name="data" id="url-config" />
</p:processor>

then in your url-generator below,

<p:input name="config" href="#url-config" />

HTH,
Hank

----- Original Message -----
From: Wang Yan
To: ; [hidden email] ;  
Sent: Friday, January 19, 2007 3:31 PM
Subject: [ops-users] Probleme : url-generator or http-serializer


Hi, I've a problem, could you give me a hand ?

Assume I have this code  below :

<p:processor name="oxf:url-generator" xmlns:p="http://www.orbeon.com/oxf/pipeline">
        <p:input name="config">
                <config>
                 <url>file.jpg</url>
                  <content-type>image/jpeg</content-type>
                <force-content-type>true</force-content-type>
            </config>
        </p:in put>
        <p:output name="data" id="image-data"/>
    </p:processor>

Assume now file.jpg and image/jpeg are data stored in the form (i.e : p:input name="data" href="#instance") :

How can I do to obtain something like this ? (the example below is wrong) :

<p:processor name="oxf:url-generator" xmlns:p="http://www.orbeon.com/oxf/pipeline">
        <p:input name="data" href="#instance"/>
        <p:input name="config">
            <config>
            &nb sp;    <url><xsl:value-of select="/form/document/url"/></url>
                  <content-type><xsl:value-of select="/form/document/content-type"/></content-type>
                <force-content-type>true</force-content-type>
            </config>
        </p:input>
        <p:output name="data" id="image-data"/>
    </p:processor>

In other word, the data changes with respect to the value in the form instance .

Thanks in advance !



-----------------------------------------------------
Romandie Annonces : http://annonces.romandie.com
Petites annonces 100% gratuites entre romands
-----------------------------------------------------



--
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: Probleme : url-generator or http-serializer

Wang Yan
Right, I think I understood.

By using xslt, we got the value of the parameters. And just make a good reference in url-generator. I h'aven't thought this.

Thank you once again.


En réponse à Hank Ratzesberger <[hidden email]> :

Hi Wang,

The examples all seem complex at first, but there
are probably snippets there for what you want to do.

You can do all kinds of things in the declarative/scripted language
of XML and its various extensions within the pipeline language.
When you want to insert/alter/produce some XML, you probably want
to use XSLT (or XUpdate). Using the xslt processor, you can create
your <config> element (untested example):

<p:processor name="oxf:xslt" >
<p:input name="data" href="#instance"/>
<p:config>
<xsl:s tylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<config xmlns="">
<url><xsl:value-of select="/form/document/url"/></url>
<content-type><xsl:value-of select="/form/document/content-type"/></content-type>
<force-content-type>true</force-content-type>
</config>
</xsl:template>
</xsl:stylesheet>
</p:config>
<p:output name="data" id="url-config" />
</p:processor>

then in your url-generator below,

<p:input name="config" href="#url-config" />

HTH,
Hank

----- Original Message -----
From: Wang Yan
To: ; [hidden email] ; < br />Sent: Friday, January 19, 2007 3:31 PM
Subject: [ops-users] Probleme : url-generator or http-serializer


Hi, I've a problem, could you give me a hand ?

Assume I have this code below :

<p:processor name="oxf:url-generator" xmlns:p="http://www.orbeon.com/oxf/pipeline">
<p:input name="config">
<config>
<url>file.jpg</url>
<content-type>image/jpeg</content-type>
<force-content-type>true</force-content-type>
</config>
</p:in put>
<p:output name="data" id="image-data"/>
</p:processor>

Assume now file.jpg and image/jpeg are data stored in the form (i.e : p:input name="data" href="#instance") :

How can I do to obtain something like this ? (the example below is wrong) :

<p:processor name="oxf:url-generator" xmlns:p="http://www.orbeon.com/oxf/pipeline">
<p:input name="data" href="#instance"/>
<p:input name="config">
<config>
&nb sp; <url><xsl:value-of select="/form/document/url"/></url>
<content-type><xsl:value-of select="/form/document/content-type"/></content-type>
<force-content-type>true</force-content-type>
</config>
</p:input>
<p:output name="data" id="image-data"/>
</p:processor>

In other word, the data changes with respect to the value in the form instance .

Thanks in adv ance !



-----------------------------------------------------
Romandie Annonces : http://annonces.romandie.com
Petites annonces 100% gratuites entre romands
-----------------------------------------------------



message-footer.txt

--
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


-----------------------------------------------------
Romandie Annonces : http://annonces.romandie.com
Petites annonces 100% gratuites entre romands
-----------------------------------------------------




--
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