Custom message

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

Custom message

Peymirat Damien
Hi all,


   I have done a little application with OPS, and I would like to
display to the screen a custom message which is generated by an XSLT
processor in my model.xpl. In fact my problem is how to display the
output of this processor to my view.xhtml to diplay it on the screen.

Thank you everybody

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
Reply | Threaded
Open this post in threaded view
|

Re: Custom message

Henrik Pettersen
Damien,

you need 3 things:
1. a pageflow definition
2. a view
3. a model (xpl)

pageflow:

    <page path-info="/my/url/to/the/application"
          view="oxf:/path/to/view.xsl"
          model="oxf:/path/to/model.xpl/>

View:

<?xml version='1.0' encoding='utf-8' ?>
<xhtml:html xmlns=" " xmlns:ev="http://www.w3.org/2001/xml-events "  xmlns:f="http://orbeon.org/oxf/xml/formatting"  xmlns:xforms="http://www.w3.org/2002/xforms"  xmlns:xhtml=" http://www.w3.org/1999/xhtml"  xmlns:xi="http://orbeon.org/oxf/xml/xinclude"  xmlns:xs=" http://www.w3.org/2001/XMLSchema"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:xxforms="http://orbeon.org/oxf/xml/xforms "  xsl:version="2.0" >
  <xhtml:head>
    <xhtml:meta content="text/html; charset=UTF-8"  http-equiv="Content-Type" ></xhtml:meta>
    <xhtml:title> My title </xhtml:title>
    <xforms:model>    
             <xforms:instance id="text">
                 <xsl:copy-of select="/"/>               
             </xforms:instance>
    </xforms:model>
</xhtml:head>
<xhtml:body>      
    <xforms:output ref="instance('text')/myText"/> <!-- note that the instance function 'eats up' the root element of your instance, so adjust your xpath accordingly -->

</xhtml:boy>
</xhtml:html>

model:
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:oxf=" http://www.orbeon.com/oxf/processors"
          xmlns:aspic="http://www.cruk.com/aspic/editor/v1">

    <p:param name="instance" type="input"/>
    <p:param name="data" type="output"/>   

    <!-- Your processor: make sure the <output> element has the 'ref="data" property -->

</p:config>

This is just from the top of my head, so fiddle around with this until you get it right. You need:

http://www.orbeon.com/ops/doc/reference-xforms-ng#d6e236
http://www.orbeon.com/ops/doc/reference-page-flow
http://www.orbeon.com/ops/doc/reference-xpl-pipelines

Hope this helps.

Henrik

On 8/23/06, Peymirat Damien <[hidden email]> wrote:
Hi all,


   I have done a little application with OPS, and I would like to
display to the screen a custom message which is generated by an XSLT
processor in my model.xpl. In fact my problem is how to display the
output of this processor to my view.xhtml to diplay it on the screen.

Thank you everybody

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





--
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: Custom message

Erik Bruchez
Administrator
In reply to this post by Peymirat Damien
Damien,

 > I have done a little application with OPS, and I would like to
 > display to the screen a custom message which is generated by an XSLT
 > processor in my model.xpl. In fact my problem is how to display the
 > output of this processor to my view.xhtml to diplay it on the
 > screen.

Have your XForms model output the resulting XML document to its
"instance" output, and then access that document from XForms with:

<xforms:instance id="my-message-instance" src="input:instance"/>

You can then bind an xforms:output to whatever node of your XML
document contains the message.

-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