I wanted to see the submission model pretty-printed on the form, and updated live, but can't get it to work (no errors). The code was adapted from the sandbox-xquery example. in the view.xhtml: <html> <head> ... <xforms:instance id="purty"> <formatted-output xmlns=""/> </xforms:instance> <xforms:bind nodeset="instance('purty')/formatted-output" calculate="xxforms:call-xpl('oxf:/apps/nexus/purtify.xpl', ('input'), <-- (instance('customer')/*), <-- probably this syntax is wrong 'formatted-output')"/> <-- ... </head> <body> <xforms:group appearance="xxforms:fieldset"> <xforms:label>Model</xforms:label> <xforms:output ref="instance('purty')/formatted-output" mediatype="text/html"/> </xforms:group> ... </body> in purtify.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:xsl="http://www.w3.org/1999/XSL/Transform"> <p:param name="input" type="input"/> <p:param name="formatted-output" type="output"/> <!-- Parse input document --> <p:processor name="oxf:xslt"> <p:input name="data" href="#input"/> <p:input name="config"> <xsl:stylesheet version="2.0"> <xsl:template match="/"> <xsl:copy-of select="saxon:parse(string(/))"/> </xsl:template> </xsl:stylesheet> </p:input> <p:output name="data" id="input-parsed"/> </p:processor> <!-- Format output --> <p:processor name="oxf:pipeline"> <p:input name="config" href="oxf:/ops/utils/formatting/format-multiple.xpl"/> <p:input name="data" href="aggregate('root',#input-parsed)"/> <p:output name="data" ref="formatted-output"/> </p:processor> </p:config> -- -- 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 |
Mike,
Funny you should say that Orbeon have just implemented something to do this, if you get a recent build you'll be able to see how this is implemented it uses a widget namespace so you can search for that :-) Ryan Ryan Puddephatt Software Engineer Teleflex Group - IT UK 1 Michaelson Square Livingston West Lothian Scotland EH54 7DP e> [hidden email] t> +44(0)1506 407 110 f> +44(0)1506 407 108 >-----Original Message----- >From: Mike Leary [mailto:[hidden email]] >Sent: 27 January 2007 00:12 >To: [hidden email] >Subject: [ops-users] live models? > > >I wanted to see the submission model pretty-printed on the >form, and updated live, but can't get it to work (no errors). >The code was adapted from the sandbox-xquery example. > > >in the view.xhtml: > ><html> ><head> >... ><xforms:instance id="purty"> > <formatted-output xmlns=""/> ></xforms:instance> > ><xforms:bind nodeset="instance('purty')/formatted-output" > calculate="xxforms:call-xpl('oxf:/apps/nexus/purtify.xpl', > ('input'), <-- > (instance('customer')/*), <-- probably this syntax is wrong > 'formatted-output')"/> <-- >... ></head> ><body> ><xforms:group appearance="xxforms:fieldset"> > <xforms:label>Model</xforms:label> > <xforms:output ref="instance('purty')/formatted-output" >mediatype="text/html"/> </xforms:group> ... ></body> > > > >in purtify.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:xsl="http://www.w3.org/1999/XSL/Transform"> > > <p:param name="input" type="input"/> > <p:param name="formatted-output" type="output"/> > > <!-- Parse input document --> > <p:processor name="oxf:xslt"> > <p:input name="data" href="#input"/> > <p:input name="config"> > <xsl:stylesheet version="2.0"> > <xsl:template match="/"> > <xsl:copy-of select="saxon:parse(string(/))"/> > </xsl:template> > </xsl:stylesheet> > </p:input> > <p:output name="data" id="input-parsed"/> > </p:processor> > > <!-- Format output --> > <p:processor name="oxf:pipeline"> > <p:input name="config" > href="oxf:/ops/utils/formatting/format-multiple.xpl"/> > <p:input name="data" href="aggregate('root',#input-parsed)"/> > <p:output name="data" ref="formatted-output"/> > </p:processor> > ></p:config> > > > >-- > > -- 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 |
For anyone playing along at home, just add this to your <body>
<widget:xforms-instance-inspector xmlns:widget="http://orbeon.org/oxf/xml/widget"/> Now to figure out why it only sees two of the many instances ... which would explain some of the other difficulties. :) On Sat, Jan 27, 2007 at 12:57:21AM +0000, Ryan Puddephatt wrote: > Mike, > Funny you should say that Orbeon have just implemented something to > do this, if you get a recent build you'll be able to see how this is > implemented it uses a widget namespace so you can search for that :-) -- -- 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 |
Seems to not be finished yet, but is workable.
Only shows the first instance in the first model -- can't change to different model or instance. Formatted looks a bit worse than plain (very wide). I'm looking forward to seeing the next version! :) On Fri, Jan 26, 2007 at 07:13:24PM -0800, Mike Leary wrote: > For anyone playing along at home, just add this to your <body> > > <widget:xforms-instance-inspector xmlns:widget="http://orbeon.org/oxf/xml/widget"/> -- -- 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 |
Argh, why do I bother posting... something in the system "cleared up"
and now it works fine... On Fri, Jan 26, 2007 at 07:43:40PM -0800, Mike Leary wrote: > Seems to not be finished yet, but is workable. -- -- 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
|
Yes it *should* show all the models and instances you have.
But you are right to say that it is not quite finished ;-) I hacked this in a few hours based on Ryan's idea of an instance debugger (he had sent a stylesheet to this list a while back). -Erik Mike Leary wrote: > Argh, why do I bother posting... something in the system "cleared up" > and now it works fine... > > On Fri, Jan 26, 2007 at 07:43:40PM -0800, Mike Leary wrote: >> Seems to not be finished yet, but is workable. -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |