Hi all,
In my project, I call a XPL file to dynamically change "my-output". At the end of the XPL file, I do a xml-converter like this : <p:processor name="oxf:xml-converter"> <p:input name="config"> <config/> </p:input> <p:input name="data" href="#result"/> <p:output name="data" ref="my-output"/> </p:processor> However, when I try to access to a value <xforms:output ref="/my-output/value1/value2"/> it doesn't work. It seems that 'my-output' contains only text because <xforms:output ref="/my-output"/> returns something : <value1><value2>test</value2></value1> Why ???? Thank you for your answers Best regards Damien. -- 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 |
Administrator
|
Damien,
I am a little lost here: where is this XPL file hooked? How is it called? How does it relate to xforms:output? What are you hoping to achieve with it? Have you tried putting @debug attributes on the inputs and outputs of your oxf:xml-converter to see exactly what goes through it? -Erik Peymirat Damien wrote: > Hi all, > > > In my project, I call a XPL file to dynamically change "my-output". > At the end of the XPL file, I do a xml-converter like this : > > <p:processor name="oxf:xml-converter"> > <p:input name="config"> > <config/> > </p:input> > <p:input name="data" href="#result"/> > <p:output name="data" ref="my-output"/> > </p:processor> > > > However, when I try to access to a value <xforms:output > ref="/my-output/value1/value2"/> it doesn't work. It seems that > 'my-output' contains only text because <xforms:output ref="/my-output"/> > returns something : > > <value1><value2>test</value2></value1> > > > Why ???? > > > Thank you for your answers > > Best regards > > Damien. Orbeon - XForms Everywhere: 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 |
In reply to this post by Peymirat Damien
Sorry Erik.
Here is my instance of view.xml <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms"> <xforms:instance> <form xmlns=""> <my-output/> <selection_projet/> </form> </xforms:instance> <xforms:bind nodeset="/form/my-output" calculate="xxforms:call-xpl ('oxf:/xmldb/call-xpl/model.xpl', 'input', /form/selection_projet, 'my-output')"/> </xforms:model> I call model.xpl to change the value of <my-output> when the value of <selection_projet> is changing. In model.xpl, I dynamically build <my-output> and I finish with oxf:xml-converter <p:processor name="oxf:xml-converter"> <p:input name="config"> <config/> </p:input> <p:input name="data" href="#result"/> <p:output name="data" ref="my-output"/> </p:processor> However, when I try to access to a value <xforms:output ref="/my-output/value1/value2"/> it doesn't work. It seems that 'my-output' contains only text because <xforms:output ref="/my-output"/> returns something : <value1><value2>test</value2></value1> So I don't understand why <my-output> contain text even if I call oxf:xml-converter ?? I hope that you understand my problem A lot of thanks Damien. -----Message d'origine----- De : Erik Bruchez [mailto:[hidden email]] De la part de Erik Bruchez Envoyé : mardi 8 août 2006 19:27 À : [hidden email] Objet : Re: [ops-users] Problem with oxf:xml-converter Damien, I am a little lost here: where is this XPL file hooked? How is it called? How does it relate to xforms:output? What are you hoping to achieve with it? Have you tried putting @debug attributes on the inputs and outputs of your oxf:xml-converter to see exactly what goes through it? -Erik Peymirat Damien wrote: > Hi all, > > > In my project, I call a XPL file to dynamically change "my-output". > At the end of the XPL file, I do a xml-converter like this : > > <p:processor name="oxf:xml-converter"> > <p:input name="config"> > <config/> > </p:input> > <p:input name="data" href="#result"/> > <p:output name="data" ref="my-output"/> > </p:processor> > > > However, when I try to access to a value <xforms:output > ref="/my-output/value1/value2"/> it doesn't work. It seems that > 'my-output' contains only text because <xforms:output > ref="/my-output"/> returns something : > > <value1><value2>test</value2></value1> > > > Why ???? > > > Thank you for your answers > > Best regards > > Damien. Orbeon - XForms Everywhere: 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 |
Administrator
|
On 8/9/06, Peymirat Damien <[hidden email]> wrote:
> However, when I try to access to a value <xforms:output ref="/my-output/value1/value2"/> it doesn't work. It seems that 'my-output' contains only text because <xforms:output ref="/my-output"/> returns something : > <value1><value2>test</value2></value1> > > > So I don't understand why <my-output> contain text even if I call oxf:xml-converter ?? Damien, The xml-converter is serializing your XML. See the example at: http://www.orbeon.com/ops/doc/processors-converters#xml-converter Maybe you just don't need to call the XML Converter in your pipeline. 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 |
In reply to this post by Peymirat Damien
I have tested your solution without success.
Here is my code : View.xml <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms"> <xforms:instance> <form xmlns=""> <selection_projet/> <my-output/> </form> </xforms:instance> <xforms:bind nodeset="/form/my-output" calculate="xxforms:call-xpl('oxf:/xmldb/call-xpl/model.xpl', 'input', /form/selection_projet, 'my-output')"/> </xforms:model> Model.xpl <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:saxon="http://saxon.sf.net/" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xdb="http://orbeon.org/oxf/xml/xmldb" xmlns:v="http://orbeon.org/oxf/xml/validation" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <p:param name="input" type="input"/> <p:param name="my-output" type="output"/> <!-- XSLT --> <p:processor name="oxf:xslt"> <p:input name="data" href="#input"/> <p:input name="config"> <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of select="string(/)"/> </projet> </config> </p:input> <p:output name="data" id="aaa"/> </p:processor> <p:processor name="oxf:xslt"> <p:input name="data" href="#aaa"/> <p:input name="config"> <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xi:include href="{/config/projet}" xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/> </config> </p:input> <p:output name="data" id="output_xslt"/> </p:processor> <p:processor name="oxf:xinclude"> <p:input name="config" href="#output_xslt"/> <p:output name="data" id="test" ref="my-output"/> </p:processor> </p:config> I would like to use <xforms:ouput ref="/form/my-output/.../..."> but I can only use <xforms:output ref="/form/my-output"> In fact, my-output contains only text and not XML. Why ?? -----Message d'origine----- De : [hidden email] [mailto:[hidden email]] De la part de Alessandro Vernet Envoyé : mercredi 9 août 2006 21:51 À : [hidden email] Objet : Re: RE : [ops-users] Problem with oxf:xml-converter On 8/9/06, Peymirat Damien <[hidden email]> wrote: > However, when I try to access to a value <xforms:output > ref="/my-output/value1/value2"/> it doesn't work. It seems that > 'my-output' contains only text because <xforms:output > ref="/my-output"/> returns something : > <value1><value2>test</value2></value1> > > > So I don't understand why <my-output> contain text even if I call > oxf:xml-converter ?? Damien, The xml-converter is serializing your XML. See the example at: http://www.orbeon.com/ops/doc/processors-converters#xml-converter Maybe you just don't need to call the XML Converter in your pipeline. 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 |
Administrator
|
Damien,
Using <xforms:bind nodeset="A" calculate="B"/>, expression B is evaluated, converted to a string, a place in the node pointed by A. So you can't use this to run an XPL file, and insert the XML generated by the XPL in your instance. I suggest you make your model.xpl a "service". Declare it in the page flow: <page path-info="/url-you-choose" view="model.xpl"/>. Change the name of the input/output to be instance/data. Then in XForms do a submission to that service: <xforms:submission ref="instance('instance-id')" id="submission-id" method="post" action="/url-you-chose" replace="instance" instance="..."/> You can run that submission when the page loads with: <xforms:action ev:event="xforms-ready"> <xforms:send submission="submission-id"/> </xforms:action> An additional benefit of doing things this way is that you avoid using the xxforms:call-xpl() extension function. Alex On 8/10/06, Peymirat Damien <[hidden email]> wrote: > I have tested your solution without success. > > Here is my code : > > View.xml > > <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms"> > <xforms:instance> > <form xmlns=""> > <selection_projet/> > <my-output/> > </form> > </xforms:instance> > <xforms:bind nodeset="/form/my-output" calculate="xxforms:call-xpl('oxf:/xmldb/call-xpl/model.xpl', 'input', /form/selection_projet, 'my-output')"/> > </xforms:model> > > > Model.xpl > > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" > xmlns:saxon="http://saxon.sf.net/" > xmlns:oxf="http://www.orbeon.com/oxf/processors" > xmlns:xdb="http://orbeon.org/oxf/xml/xmldb" > xmlns:v="http://orbeon.org/oxf/xml/validation" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:xi="http://www.w3.org/2001/XInclude" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <p:param name="input" type="input"/> > <p:param name="my-output" type="output"/> > <!-- XSLT --> > <p:processor name="oxf:xslt"> > <p:input name="data" href="#input"/> > <p:input name="config"> > <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of select="string(/)"/> > </projet> > </config> > </p:input> > <p:output name="data" id="aaa"/> > </p:processor> > <p:processor name="oxf:xslt"> > <p:input name="data" href="#aaa"/> > <p:input name="config"> > <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xi:include href="{/config/projet}" xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/> > </config> > </p:input> > <p:output name="data" id="output_xslt"/> > </p:processor> > <p:processor name="oxf:xinclude"> > <p:input name="config" href="#output_xslt"/> > <p:output name="data" id="test" ref="my-output"/> > </p:processor> > </p:config> > > > > I would like to use <xforms:ouput ref="/form/my-output/.../..."> but I can only use <xforms:output ref="/form/my-output"> > In fact, my-output contains only text and not XML. Why ?? > > > -----Message d'origine----- > De : [hidden email] [mailto:[hidden email]] De la part de Alessandro Vernet > Envoyé : mercredi 9 août 2006 21:51 > À : [hidden email] > Objet : Re: RE : [ops-users] Problem with oxf:xml-converter > > > On 8/9/06, Peymirat Damien <[hidden email]> wrote: > > However, when I try to access to a value <xforms:output > > ref="/my-output/value1/value2"/> it doesn't work. It seems that > > 'my-output' contains only text because <xforms:output > > ref="/my-output"/> returns something : > > <value1><value2>test</value2></value1> > > > > > > So I don't understand why <my-output> contain text even if I call > > oxf:xml-converter ?? > > Damien, > > The xml-converter is serializing your XML. See the example at: http://www.orbeon.com/ops/doc/processors-converters#xml-converter > > Maybe you just don't need to call the XML Converter in your pipeline. > > 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 > > > -- 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 |
Administrator
|
Damien,
Another solution is to not use @calculate or xforms:setvalue, which won't work as Alex pointed out because they deal with strings, but to use xforms:insert's @origin attribute, something like: <xforms:insert context="/form/my-output" nodeset="dummy" origin="xxforms:call-xpl('oxf:/xmldb/call-xpl/model.xpl', 'input', /form/selection_projet, 'my-output')"/> -Erik Alessandro Vernet wrote: > Damien, > > Using <xforms:bind nodeset="A" calculate="B"/>, expression B is > evaluated, converted to a string, a place in the node pointed by A. So > you can't use this to run an XPL file, and insert the XML generated by > the XPL in your instance. > > I suggest you make your model.xpl a "service". Declare it in the page > flow: <page path-info="/url-you-choose" view="model.xpl"/>. Change the > name of the input/output to be instance/data. Then in XForms do a > submission to that service: > > <xforms:submission ref="instance('instance-id')" id="submission-id" > method="post" action="/url-you-chose" replace="instance" > instance="..."/> > > You can run that submission when the page loads with: > > <xforms:action ev:event="xforms-ready"> > <xforms:send submission="submission-id"/> > </xforms:action> > > An additional benefit of doing things this way is that you avoid using > the xxforms:call-xpl() extension function. > > Alex > > On 8/10/06, Peymirat Damien <[hidden email]> wrote: >> I have tested your solution without success. >> >> Here is my code : >> >> View.xml >> >> <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms"> >> <xforms:instance> >> <form xmlns=""> >> <selection_projet/> >> <my-output/> >> </form> >> </xforms:instance> >> <xforms:bind nodeset="/form/my-output" >> calculate="xxforms:call-xpl('oxf:/xmldb/call-xpl/model.xpl', 'input', >> /form/selection_projet, 'my-output')"/> >> </xforms:model> >> >> >> Model.xpl >> >> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" >> xmlns:saxon="http://saxon.sf.net/" >> xmlns:oxf="http://www.orbeon.com/oxf/processors" >> xmlns:xdb="http://orbeon.org/oxf/xml/xmldb" >> xmlns:v="http://orbeon.org/oxf/xml/validation" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >> xmlns:xi="http://www.w3.org/2001/XInclude" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >> <p:param name="input" type="input"/> >> <p:param name="my-output" type="output"/> >> <!-- XSLT --> >> <p:processor name="oxf:xslt"> >> <p:input name="data" href="#input"/> >> <p:input name="config"> >> <config xsl:version="2.0" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> >> >> <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of >> select="string(/)"/> >> </projet> >> </config> >> </p:input> >> <p:output name="data" id="aaa"/> >> </p:processor> >> <p:processor name="oxf:xslt"> >> <p:input name="data" href="#aaa"/> >> <p:input name="config"> >> <config xsl:version="2.0" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> >> <xi:include href="{/config/projet}" >> xmlns:saxon="http://saxon.sf.net/" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/> >> </config> >> </p:input> >> <p:output name="data" id="output_xslt"/> >> </p:processor> >> <p:processor name="oxf:xinclude"> >> <p:input name="config" href="#output_xslt"/> >> <p:output name="data" id="test" ref="my-output"/> >> </p:processor> >> </p:config> >> >> >> >> I would like to use <xforms:ouput ref="/form/my-output/.../..."> but I >> can only use <xforms:output ref="/form/my-output"> >> In fact, my-output contains only text and not XML. Why ?? >> >> >> -----Message d'origine----- >> De : [hidden email] [mailto:[hidden email]] De la part de >> Alessandro Vernet >> Envoyé : mercredi 9 août 2006 21:51 >> À : [hidden email] >> Objet : Re: RE : [ops-users] Problem with oxf:xml-converter >> >> >> On 8/9/06, Peymirat Damien <[hidden email]> wrote: >> > However, when I try to access to a value <xforms:output >> > ref="/my-output/value1/value2"/> it doesn't work. It seems that >> > 'my-output' contains only text because <xforms:output >> > ref="/my-output"/> returns something : >> > <value1><value2>test</value2></value1> >> > >> > >> > So I don't understand why <my-output> contain text even if I call >> > oxf:xml-converter ?? >> >> Damien, >> >> The xml-converter is serializing your XML. See the example at: >> http://www.orbeon.com/ops/doc/processors-converters#xml-converter >> >> Maybe you just don't need to call the XML Converter in your pipeline. >> >> 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 >> >> >> > > > > ------------------------------------------------------------------------ > > > -- > 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 -- Orbeon - XForms Everywhere: 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 |
In reply to this post by Peymirat Damien
Erik,
It works well with your solution. I would like to know if I am forced to use a trigger with a button to dynamically create my /form/my-output. Is it possible to do this automatically each time /form/selection_projet changed ?? Thank you Erik & Alex for your answers Best regards Damien. -----Message d'origine----- De : Erik Bruchez [mailto:[hidden email]] De la part de Erik Bruchez Envoyé : jeudi 10 août 2006 20:39 À : [hidden email] Objet : Re: RE : RE : [ops-users] Problem with oxf:xml-converter Damien, Another solution is to not use @calculate or xforms:setvalue, which won't work as Alex pointed out because they deal with strings, but to use xforms:insert's @origin attribute, something like: <xforms:insert context="/form/my-output" nodeset="dummy" origin="xxforms:call-xpl('oxf:/xmldb/call-xpl/model.xpl', 'input', /form/selection_projet, 'my-output')"/> -Erik Alessandro Vernet wrote: > Damien, > > Using <xforms:bind nodeset="A" calculate="B"/>, expression B is > evaluated, converted to a string, a place in the node pointed by A. So > you can't use this to run an XPL file, and insert the XML generated by > the XPL in your instance. > > I suggest you make your model.xpl a "service". Declare it in the page > flow: <page path-info="/url-you-choose" view="model.xpl"/>. Change the > name of the input/output to be instance/data. Then in XForms do a > submission to that service: > > <xforms:submission ref="instance('instance-id')" id="submission-id" > method="post" action="/url-you-chose" replace="instance" > instance="..."/> > > You can run that submission when the page loads with: > > <xforms:action ev:event="xforms-ready"> > <xforms:send submission="submission-id"/> > </xforms:action> > > An additional benefit of doing things this way is that you avoid using > the xxforms:call-xpl() extension function. > > Alex > > On 8/10/06, Peymirat Damien <[hidden email]> wrote: >> I have tested your solution without success. >> >> Here is my code : >> >> View.xml >> >> <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms"> >> <xforms:instance> >> <form xmlns=""> >> <selection_projet/> >> <my-output/> >> </form> >> </xforms:instance> >> <xforms:bind nodeset="/form/my-output" >> calculate="xxforms:call-xpl('oxf:/xmldb/call-xpl/model.xpl', 'input', >> /form/selection_projet, 'my-output')"/> </xforms:model> >> >> >> Model.xpl >> >> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" >> xmlns:saxon="http://saxon.sf.net/" >> xmlns:oxf="http://www.orbeon.com/oxf/processors" >> xmlns:xdb="http://orbeon.org/oxf/xml/xmldb" >> xmlns:v="http://orbeon.org/oxf/xml/validation" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >> xmlns:xi="http://www.w3.org/2001/XInclude" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >> <p:param name="input" type="input"/> >> <p:param name="my-output" type="output"/> >> <!-- XSLT --> >> <p:processor name="oxf:xslt"> >> <p:input name="data" href="#input"/> >> <p:input name="config"> >> <config xsl:version="2.0" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> >> >> <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of >> select="string(/)"/> >> </projet> >> </config> >> </p:input> >> <p:output name="data" id="aaa"/> >> </p:processor> >> <p:processor name="oxf:xslt"> >> <p:input name="data" href="#aaa"/> >> <p:input name="config"> >> <config xsl:version="2.0" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> >> <xi:include href="{/config/projet}" >> xmlns:saxon="http://saxon.sf.net/" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/> >> </config> >> </p:input> >> <p:output name="data" id="output_xslt"/> >> </p:processor> >> <p:processor name="oxf:xinclude"> >> <p:input name="config" href="#output_xslt"/> >> <p:output name="data" id="test" ref="my-output"/> >> </p:processor> >> </p:config> >> >> >> >> I would like to use <xforms:ouput ref="/form/my-output/.../..."> but >> I >> can only use <xforms:output ref="/form/my-output"> >> In fact, my-output contains only text and not XML. Why ?? >> >> >> -----Message d'origine----- >> De : [hidden email] [mailto:[hidden email]] De la part de >> Alessandro Vernet Envoyé : mercredi 9 août 2006 21:51 >> À : [hidden email] >> Objet : Re: RE : [ops-users] Problem with oxf:xml-converter >> >> >> On 8/9/06, Peymirat Damien <[hidden email]> wrote: >> > However, when I try to access to a value <xforms:output >> > ref="/my-output/value1/value2"/> it doesn't work. It seems that >> > 'my-output' contains only text because <xforms:output >> > ref="/my-output"/> returns something : >> > <value1><value2>test</value2></value1> >> > >> > >> > So I don't understand why <my-output> contain text even if I call >> > oxf:xml-converter ?? >> >> Damien, >> >> The xml-converter is serializing your XML. See the example at: >> http://www.orbeon.com/ops/doc/processors-converters#xml-converter >> >> Maybe you just don't need to call the XML Converter in your pipeline. >> >> 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 >> >> >> > > > > ---------------------------------------------------------------------- > -- > > > -- > 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 -- Orbeon - XForms Everywhere: 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 |
Administrator
|
Damien,
If /form/selection_projet is bound to a control, you can capture xforms-value-changed on that control to perform the update. -Erik Peymirat Damien wrote: > Erik, > > It works well with your solution. I would like to know if I am forced to use a trigger with a button to dynamically create my /form/my-output. Is it possible to do this automatically each time /form/selection_projet changed ?? > > > Thank you Erik & Alex for your answers > > Best regards > > Damien. > > -----Message d'origine----- > De : Erik Bruchez [mailto:[hidden email]] De la part de Erik Bruchez Envoyé : jeudi 10 août 2006 20:39 À : [hidden email] Objet : Re: RE : RE : [ops-users] Problem with oxf:xml-converter > > > Damien, > > Another solution is to not use @calculate or xforms:setvalue, which > won't work as Alex pointed out because they deal with strings, but to > use xforms:insert's @origin attribute, something like: > > <xforms:insert context="/form/my-output" > nodeset="dummy" > origin="xxforms:call-xpl('oxf:/xmldb/call-xpl/model.xpl', 'input', > /form/selection_projet, 'my-output')"/> > > -Erik > > Alessandro Vernet wrote: >> Damien, >> >> Using <xforms:bind nodeset="A" calculate="B"/>, expression B is >> evaluated, converted to a string, a place in the node pointed by A. So >> you can't use this to run an XPL file, and insert the XML generated by >> the XPL in your instance. >> >> I suggest you make your model.xpl a "service". Declare it in the page >> flow: <page path-info="/url-you-choose" view="model.xpl"/>. Change the >> name of the input/output to be instance/data. Then in XForms do a >> submission to that service: >> >> <xforms:submission ref="instance('instance-id')" id="submission-id" >> method="post" action="/url-you-chose" replace="instance" >> instance="..."/> >> >> You can run that submission when the page loads with: >> >> <xforms:action ev:event="xforms-ready"> >> <xforms:send submission="submission-id"/> >> </xforms:action> >> >> An additional benefit of doing things this way is that you avoid using >> the xxforms:call-xpl() extension function. >> >> Alex >> >> On 8/10/06, Peymirat Damien <[hidden email]> wrote: >>> I have tested your solution without success. >>> >>> Here is my code : >>> >>> View.xml >>> >>> <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms"> >>> <xforms:instance> >>> <form xmlns=""> >>> <selection_projet/> >>> <my-output/> >>> </form> >>> </xforms:instance> >>> <xforms:bind nodeset="/form/my-output" >>> calculate="xxforms:call-xpl('oxf:/xmldb/call-xpl/model.xpl', 'input', >>> /form/selection_projet, 'my-output')"/> </xforms:model> >>> >>> >>> Model.xpl >>> >>> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" >>> xmlns:saxon="http://saxon.sf.net/" >>> xmlns:oxf="http://www.orbeon.com/oxf/processors" >>> xmlns:xdb="http://orbeon.org/oxf/xml/xmldb" >>> xmlns:v="http://orbeon.org/oxf/xml/validation" >>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >>> xmlns:xi="http://www.w3.org/2001/XInclude" >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >>> <p:param name="input" type="input"/> >>> <p:param name="my-output" type="output"/> >>> <!-- XSLT --> >>> <p:processor name="oxf:xslt"> >>> <p:input name="data" href="#input"/> >>> <p:input name="config"> >>> <config xsl:version="2.0" >>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> >>> >>> <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of >>> select="string(/)"/> >>> </projet> >>> </config> >>> </p:input> >>> <p:output name="data" id="aaa"/> >>> </p:processor> >>> <p:processor name="oxf:xslt"> >>> <p:input name="data" href="#aaa"/> >>> <p:input name="config"> >>> <config xsl:version="2.0" >>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> >>> <xi:include href="{/config/projet}" >>> xmlns:saxon="http://saxon.sf.net/" >>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/> >>> </config> >>> </p:input> >>> <p:output name="data" id="output_xslt"/> >>> </p:processor> >>> <p:processor name="oxf:xinclude"> >>> <p:input name="config" href="#output_xslt"/> >>> <p:output name="data" id="test" ref="my-output"/> >>> </p:processor> >>> </p:config> >>> >>> >>> >>> I would like to use <xforms:ouput ref="/form/my-output/.../..."> but >>> I >>> can only use <xforms:output ref="/form/my-output"> >>> In fact, my-output contains only text and not XML. Why ?? >>> >>> >>> -----Message d'origine----- >>> De : [hidden email] [mailto:[hidden email]] De la part de >>> Alessandro Vernet Envoyé : mercredi 9 août 2006 21:51 >>> À : [hidden email] >>> Objet : Re: RE : [ops-users] Problem with oxf:xml-converter >>> >>> >>> On 8/9/06, Peymirat Damien <[hidden email]> wrote: >>>> However, when I try to access to a value <xforms:output >>>> ref="/my-output/value1/value2"/> it doesn't work. It seems that >>>> 'my-output' contains only text because <xforms:output >>>> ref="/my-output"/> returns something : >>>> <value1><value2>test</value2></value1> >>>> >>>> >>>> So I don't understand why <my-output> contain text even if I call >>>> oxf:xml-converter ?? >>> Damien, >>> >>> The xml-converter is serializing your XML. See the example at: >>> http://www.orbeon.com/ops/doc/processors-converters#xml-converter >>> >>> Maybe you just don't need to call the XML Converter in your pipeline. >>> >>> 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 >>> >>> >>> >> >> >> ---------------------------------------------------------------------- >> -- >> >> >> -- >> 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 > > > > ------------------------------------------------------------------------ > > > -- > 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 -- Orbeon - XForms Everywhere: 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 |
Administrator
|
In reply to this post by Peymirat Damien
Peymirat Damien wrote:
> I would like to use <xforms:ouput ref="/form/my-output/.../..."> but I can only use <xforms:output ref="/form/my-output"> > In fact, my-output contains only text and not XML. Why ?? Because xforms:output displays text unless you use the @mediatype attribute, e.g.: <xforms:output ref="..." mediatype="text/html"/> -Erik -- Orbeon - XForms Everywhere: 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 |
Free forum by Nabble | Edit this page |