submitting non-xml content

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

submitting non-xml content

patrick
hi
i can't get get to submit text content, i have this:

<xforms:submission id="generate" ref="xxforms:instance('instancep')"
                         method="post" resource="http://example.com" 
                        xxforms:username="test" xxforms:password="test"
                         replace="text" targetref="xxforms:instance('fr-form-instance')/myvalue"
                         mediatype="text/plain" omit-xml-declaration="true" >         
                         <xforms:header >


<xforms:instance id="instancep">
<test xmlns="">
   myvalue
     </test>
</xforms:instance>

but when i do the post, content type is "text/plain" BUT it sends:

<test xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"  xmlns:ev="http://www.w3.org/2001/xml-events">my value\n</test>

How can i get to send only the text value of this (ie. "my value")??

i've read in wiki orbeon doc to use serialization="text/plain" but this does not work!

PLEASE HELP, THANKS!!

Reply | Threaded
Open this post in threaded view
|

Re: submitting non-xml content

Erik Bruchez
Administrator
Patrick,

Try using text/plain on the serialization attribute instead of the mediatype attribute.

-Erik

On Fri, Jan 28, 2011 at 8:22 AM, patrick <[hidden email]> wrote:

hi
i can't get get to submit text content, i have this:

<xforms:submission id="generate" ref="xxforms:instance('instancep')"
                        method="post" resource="http://example.com"
                       xxforms:username="test" xxforms:password="test"
                        replace="text" targetref="xxforms:instance('fr-form-instance')/myvalue"
                        mediatype="text/plain" omit-xml-declaration="true" >
                        <xforms:header >


<xforms:instance id="instancep">
<test xmlns="">
  myvalue
    </test>
</xforms:instance>

but when i do the post, content type is "text/plain" BUT it sends:

<test xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:ev="http://www.w3.org/2001/xml-events">my value\n</test>

How can i get to send only the text value of this (ie. "my value")??

i've read in wiki orbeon doc to use serialization="text/plain" but this does
not work!

PLEASE HELP, THANKS!!


--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/submitting-non-xml-content-tp3244844p3244844.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: submitting non-xml content

patrick
hi

it didn't work with what you suggested but i eventually solved it with:
<xforms:setvalue ev:event="xforms-submit-serialize" ref="event('submission-body')">

now i have another problem, how i can set dynamically a value with xforms:setvalue in my XPL?? the value i need to set should be retrieved from a XSL transformation:

 <p:processor name="oxf:pipeline">
    <p:input name="config" href="transform.xpl"/>
    <p:input name="xml" href="#instance" />
    <p:output name="xml-clean" id="stripped-instance"/>
  </p:processor>


<p:processor name="oxf:xforms-submission">
<p:input name="submission">
        <xforms:submission
                         method="post"  resource="http://test/id/{/myXSLValue}"  
                        xxforms:username="xxx" xxforms:password="xxx"
                        mediatype="text/plain" serialization="application/x-www-form-urlencoded" omit-xml-declaration="true">         
        <xforms:setvalue ev:event="xforms-submit-serialize" ref="event('submission-body')" value="{/myXSLValue}">
        </xforms:setvalue> 
</xforms:submission>
</p:input>
<p:input name="request" href="#stripped-instance">
</p:input>
<p:output name="response" ref="data" />
</p:processor>


{/myXSLValue} is retrieved in the field resource of xforms:submission but NOT in the field value of xforms:setvalue
How can i do ?? Please help!
Reply | Threaded
Open this post in threaded view
|

Re: Re: submitting non-xml content

Erik Bruchez
Administrator
xforms:setvalue takes an XPath expression, so you don't need the curly brackets. Try:

value="/myXSLValue"

-Erik

On Tue, Feb 1, 2011 at 6:44 AM, patrick <[hidden email]> wrote:

hi

it didn't work with what you suggested but i eventually solved it with:
<xforms:setvalue ev:event="xforms-submit-serialize"
ref="event('submission-body')">

now i have another problem, how i can set dynamically a value with
xforms:setvalue in my XPL?? the value i need to set should be retrieved from
a XSL transformation:

 <p:processor name="oxf:pipeline">
   <p:input name="config" href="transform.xpl"/>
   <p:input name="xml" href="#instance" />
   <p:output name="xml-clean" id="stripped-instance"/>
 </p:processor>


<p:processor name="oxf:xforms-submission">
<p:input name="submission">
       <xforms:submission
                        method="post"  resource="<a href="http://test/id/{/myXSLValue}" target="_blank">http://test/id/{/myXSLValue}"
                       xxforms:username="xxx" xxforms:password="xxx"
                       mediatype="text/plain" serialization="application/x-www-form-urlencoded"
omit-xml-declaration="true">
       <xforms:setvalue ev:event="xforms-submit-serialize"
ref="event('submission-body')" value="{/myXSLValue}">
       </xforms:setvalue>
</xforms:submission>
</p:input>
<p:input name="request" href="#stripped-instance">
</p:input>
<p:output name="response" ref="data" />
</p:processor>


{/myXSLValue} is retrieved in the field resource of xforms:submission but
NOT in the field value of xforms:setvalue
How can i do ?? Please help!

--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/submitting-non-xml-content-tp3244844p3251653.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
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
OW2 mailing lists service home page: http://www.ow2.org/wws