Dear people,
I would like to wish all of you a very good 2007! I am wondering if it is possible to use looping within a sql:connection. My input document looks like: <root> <query> BEGIN; </query> <query> CREATE temp table blah( . .. . ); </query> <update> INSERT INTO blah ( . .. . ); </query> <result-query> SELECT * from blah; </result-query> <query> ROLLBACK; </query> </root> I want to do: <sql:connection> <xsl:for-each select="/root/*"> <xsl:if test="query"> <sql:execute> <sql:query> <sql:param type="oxf:literalString" select="." replace="true" /> </sql:query> <sql:result-set result-sets="1"> <sql:row-iterator> </sql:row-iterator> </sql:result-set> <sql:no-results> <text>No result</text> </sql:no-results> </sql:execute> </xsl:if> <xsl:if test="update"> <sql:execute> <sql:update> <sql:param type="oxf:literalString" select="." replace="true" /> </sql:update> </sql:execute> </xsl:if> <xsl:if test="result-query"> <sql:execute> <sql:query> <sql:param type="oxf:literalString" select="." replace="true" /> </sql:query> <sql:result-set result-sets="1"> <result> <sql:row-iterator> <sql:get-columns format="xml"> <!-- <sql:exclude>first_name</sql:exclude> --> </sql:get-columns> </sql:row-iterator> </result> </sql:result-set> <sql:no-results> <text>No result</text> </sql:no-results> </sql:execute> </xsl:if> </xsl:for-each> </sql:connection> This does not appear to do what I want it to do as the <xsl:for-each> tags are outputted, they don't seem to be interpreted. Is there another way in which I can achieve 'looping' within a sql:connection? -- Met vriendelijke groet, Michiel Roos netcreators.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 |
Happy New Year to everyone!
I believe we have found some OF bug (I am using latest night build) with the newly added dialog. It seems to break when dialog is called on event "xforms-ready" - it simply does not show. In the example below you can see the behavior: 1) Dialog is working OK when called in action triggered by submission using submit button. See this when line <!--xforms:send submission="app-submit" /--> is commented out. 2) Dialog breaks when you remove the comments and try to call the dialog on xforms-ready event. Is there some possible init problem with the dialog or is there another way to call the dialog during xforms ready action? -peter <xhtml:html xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> <xhtml:head> <xforms:model> <xforms:instance id="request"> <request /> </xforms:instance> <xforms:instance id="response"> <response /> </xforms:instance> <xforms:submission method="post" mediatype="text/xml" replace="instance" action="http://localhost:8888/test/test" id="app-submit" ref="instance('request')" instance="response"> <xforms:action ev:event="xforms-submit-done"> <xxforms:show dialog="message-box" ev:event="DOMActivate" /> </xforms:action> </xforms:submission> <xforms:action ev:event="xforms-ready"> <!--xforms:send submission="app-submit" /--> </xforms:action> </xforms:model> </xhtml:head> <xhtml:body> <xxforms:dialog id="message-box" modal="true" close="true"> <xforms:label>Test</xforms:label> <xforms:trigger> <xforms:label>Close</xforms:label> <xxforms:hide dialog="message-box" ev:event="DOMActivate" /> </xforms:trigger> </xxforms:dialog> <xforms:submit submission="app-submit"> <xforms:label>Submit</xforms:label> </xforms:submit> </xhtml:body> </xhtml:html> -- 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 |
Peter,
I had this problem before .... I wanted a dialog to show on page load .... this is how I accomplished it ... <!-- put name of the event to call in the model --> <xforms:model id="main-model" xxforms:external-events="get-content-data"> <xforms:action ev:event="xforms-ready"> <xxforms:script>ORBEON.xforms.Document.dispatchEvent("main-model", "get-content-data", null, null, true, false);</xxforms:script> </xforms:action> <!-- event called from javascript --> <xforms:action ev:event="get-content-data"> <xxforms:show dialog="myDialog"/> </xforms:action> Steve Peter Kolarov wrote: Happy New Year to everyone! I believe we have found some OF bug (I am using latest night build) with the newly added dialog. It seems to break when dialog is called on event "xforms-ready" - it simply does not show. In the example below you can see the behavior: 1) Dialog is working OK when called in action triggered by submission using submit button. See this when line <!--xforms:send submission="app-submit" /--> is commented out. 2) Dialog breaks when you remove the comments and try to call the dialog on xforms-ready event. Is there some possible init problem with the dialog or is there another way to call the dialog during xforms ready action? -peter <xhtml:html xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> <xhtml:head> <xforms:model> <xforms:instance id="request"> <request /> </xforms:instance> <xforms:instance id="response"> <response /> </xforms:instance> <xforms:submission method="post" mediatype="text/xml" replace="instance" action="http://localhost:8888/test/test" id="app-submit" ref="instance('request')" instance="response"> <xforms:action ev:event="xforms-submit-done"> <xxforms:show dialog="message-box" ev:event="DOMActivate" /> </xforms:action> </xforms:submission> <xforms:action ev:event="xforms-ready"> <!--xforms:send submission="app-submit" /--> </xforms:action> </xforms:model> </xhtml:head> <xhtml:body> <xxforms:dialog id="message-box" modal="true" close="true"> <xforms:label>Test</xforms:label> <xforms:trigger> <xforms:label>Close</xforms:label> <xxforms:hide dialog="message-box" ev:event="DOMActivate" /> </xforms:trigger> </xxforms:dialog> <xforms:submit submission="app-submit"> <xforms:label>Submit</xforms:label> </xforms:submit> </xhtml:body> </xhtml:html> -- 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 slenhart.vcf (299 bytes) Download Attachment |
In reply to this post by Michiel Roos [netcreators]
Michiel,
Run this XSL through the oxf:xslt processor then use the output in the sql processor :-) 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: Michiel Roos [mailto:[hidden email]] >Sent: 02 January 2007 12:00 >To: [hidden email] >Subject: [ops-users] Usage of xsl:for-each within sql:connection > >Dear people, > >I would like to wish all of you a very good 2007! > >I am wondering if it is possible to use looping within a >sql:connection. > >My input document looks like: ><root> > <query> > BEGIN; > </query> > <query> > CREATE temp table blah( . .. . ); > </query> > <update> > INSERT INTO blah ( . .. . ); > </query> > <result-query> > SELECT * from blah; > </result-query> > <query> > ROLLBACK; > </query> ></root> > >I want to do: > > <sql:connection> > > <xsl:for-each select="/root/*"> > <xsl:if test="query"> > <sql:execute> > <sql:query> > <sql:param type="oxf:literalString" select="." >replace="true" /> > </sql:query> > <sql:result-set result-sets="1"> > <sql:row-iterator> > </sql:row-iterator> > </sql:result-set> > <sql:no-results> > <text>No result</text> > </sql:no-results> > </sql:execute> > </xsl:if> > > <xsl:if test="update"> > <sql:execute> > <sql:update> > <sql:param type="oxf:literalString" select="." >replace="true" /> > </sql:update> > </sql:execute> > </xsl:if> > > <xsl:if test="result-query"> > <sql:execute> > <sql:query> > <sql:param type="oxf:literalString" select="." >replace="true" /> > </sql:query> > <sql:result-set result-sets="1"> > <result> > <sql:row-iterator> > <sql:get-columns format="xml"> ><!-- <sql:exclude>first_name</sql:exclude> --> > </sql:get-columns> > </sql:row-iterator> > </result> > </sql:result-set> > <sql:no-results> > <text>No result</text> > </sql:no-results> > </sql:execute> > </xsl:if> > > </xsl:for-each> > > </sql:connection> > > >This does not appear to do what I want it to do as the ><xsl:for-each> tags are outputted, they don't seem to be interpreted. > >Is there another way in which I can achieve 'looping' within a >sql:connection? > >-- > >Met vriendelijke groet, > > >Michiel Roos >netcreators.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 |
Ok Ryan,
It's clunky, ugly and it smells really bad, but it works ;-). Thanks for the tip. Here's my xsl: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:sql="http://orbeon.org/oxf/xml/sql" > <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:template match="/"> <sql:config> <sql:connection> <xsl:for-each select="/root"> <xsl:apply-templates /> </xsl:for-each> </sql:connection> </sql:config> </xsl:template> <xsl:template match="query"> <sql:execute> <sql:query> <xsl:value-of select="." /> </sql:query> <sql:result-set result-sets="1"> <sql:row-iterator> </sql:row-iterator> </sql:result-set> <sql:no-results> <text>No result</text> </sql:no-results> </sql:execute> </xsl:template> <xsl:template match="update"> <sql:execute> <sql:query> <xsl:value-of select="." /> </sql:query> </sql:execute> </xsl:template> <xsl:template match="result-query"> <sql:execute> <sql:query> <xsl:value-of select="." /> </sql:query> <sql:result-set result-sets="1"> <result> <sql:row-iterator> <sql:get-columns format="xml"> <!-- <sql:exclude>first_name</sql:exclude> --> </sql:get-columns> </sql:row-iterator> </result> </sql:result-set> <sql:no-results> <text>No result</text> </sql:no-results> </sql:execute> </xsl:template> </xsl:stylesheet> And the xpl bits: <!-- transform model into SQL config --> <p:processor name="oxf:xslt"> <p:input name="config" href="validation-sql-config-generator.xsl"/> <p:input name="data" href="#validation-sql"/> <p:output name="data" id="validation-sql-config"/> </p:processor> <!-- SQL processor, insert validation data --> <p:processor name="oxf:sql"> <p:input name="data" href="#validation-sql-config" /> <p:input name="datasource" href="#datasource-validate" /> <p:input name="config" href="#validation-sql-config" /> <p:output name="data" ref="data"/> </p:processor> Ryan Puddephatt wrote: > Michiel, > Run this XSL through the oxf:xslt processor then use the output in > the sql processor :-) > > Ryan > -- Met vriendelijke groet, Michiel Roos netcreators.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 |
In reply to this post by Ryan Puddephatt
Excuse, the update bit in the xsl should read:
<xsl:template match="update"> <sql:execute> <sql:update> <xsl:value-of select="." /> </sql:update> </sql:execute> </xsl:template> -- Met vriendelijke groet, Michiel Roos netcreators.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 |
In reply to this post by Michiel Roos [netcreators]
I'm afraid this is the only way to do this, although I believe there was
once talk of a transform attribute on p:inputs, which could be used in a similar way as it is in the page-flow, but I'm guessing this will now be decided in the xpl work group 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: Michiel Roos [mailto:[hidden email]] >Sent: 02 January 2007 15:44 >To: [hidden email] >Subject: Re: [ops-users] Usage of xsl:for-each within sql:connection > >Ok Ryan, > >It's clunky, ugly and it smells really bad, but it works ;-). >Thanks for the tip. Here's my xsl: > ><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >version="1.0" > xmlns:sql="http://orbeon.org/oxf/xml/sql" > > > <xsl:output method="xml" omit-xml-declaration="yes"/> > <xsl:template match="/"> > > <sql:config> > <sql:connection> > > <xsl:for-each select="/root"> > <xsl:apply-templates /> > </xsl:for-each> > > </sql:connection> > </sql:config> > > </xsl:template> > > <xsl:template match="query"> > <sql:execute> > <sql:query> > <xsl:value-of select="." /> > </sql:query> > <sql:result-set result-sets="1"> > <sql:row-iterator> > </sql:row-iterator> > </sql:result-set> > <sql:no-results> > <text>No result</text> > </sql:no-results> > </sql:execute> > </xsl:template> > > <xsl:template match="update"> > <sql:execute> > <sql:query> > <xsl:value-of select="." /> > </sql:query> > </sql:execute> > </xsl:template> > > <xsl:template match="result-query"> > <sql:execute> > <sql:query> > <xsl:value-of select="." /> > </sql:query> > <sql:result-set result-sets="1"> > <result> > <sql:row-iterator> > <sql:get-columns format="xml"> > <!-- ><sql:exclude>first_name</sql:exclude> --> > </sql:get-columns> > </sql:row-iterator> > </result> > </sql:result-set> > <sql:no-results> > <text>No result</text> > </sql:no-results> > </sql:execute> > </xsl:template> > ></xsl:stylesheet> > >And the xpl bits: > > <!-- transform model into SQL config --> > <p:processor name="oxf:xslt"> > <p:input name="config" href="validation-sql-config-generator.xsl"/> > <p:input name="data" href="#validation-sql"/> > <p:output name="data" id="validation-sql-config"/> > </p:processor> > > > <!-- SQL processor, insert validation data --> > <p:processor name="oxf:sql"> > <p:input name="data" href="#validation-sql-config" /> > <p:input name="datasource" href="#datasource-validate" /> > <p:input name="config" href="#validation-sql-config" /> > <p:output name="data" ref="data"/> > </p:processor> > > > >Ryan Puddephatt wrote: >> Michiel, >> Run this XSL through the oxf:xslt processor then use >the output in >> the sql processor :-) >> >> Ryan >> > >-- > >Met vriendelijke groet, > > >Michiel Roos >netcreators.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 |
In reply to this post by Steve Lenhart
Thanks Steve, I will give this a shot!
Even though it would be nice if OF guys could somehow fix it for 3.5 release J -peter From: Steve Lenhart [mailto:[hidden email]]
Peter, Happy New Year to everyone!
I believe we have found some OF bug (I am using latest night build) with the newly added dialog. It seems to break when dialog is called on event "xforms-ready" - it simply does not show. In the example below you can see the behavior:
1) Dialog is working OK when called in action triggered by submission using submit button. See this when line <!--xforms:send submission="app-submit" /--> is commented out.
2) Dialog breaks when you remove the comments and try to call the dialog on xforms-ready event.
Is there some possible init problem with the dialog or is there another way to call the dialog during xforms ready action?
-peter
<xhtml:html xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> <xhtml:head> <xforms:model> <xforms:instance id="request"> <request /> </xforms:instance> <xforms:instance id="response"> <response /> </xforms:instance> <xforms:submission method="post" mediatype="text/xml" replace="instance" action="http://localhost:8888/test/test" id="app-submit" ref="instance('request')" instance="response"> <xforms:action ev:event="xforms-submit-done"> <xxforms:show dialog="message-box" ev:event="DOMActivate" /> </xforms:action> </xforms:submission> <xforms:action ev:event="xforms-ready"> <!--xforms:send submission="app-submit" /--> </xforms:action> </xforms:model> </xhtml:head> <xhtml:body> <xxforms:dialog id="message-box" modal="true" close="true"> <xforms:label>Test</xforms:label> <xforms:trigger> <xforms:label>Close</xforms:label> <xxforms:hide dialog="message-box" ev:event="DOMActivate" /> </xforms:trigger> </xxforms:dialog> <xforms:submit submission="app-submit"> <xforms:label>Submit</xforms:label> </xforms:submit> </xhtml:body> </xhtml:html>
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] 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 |
Administrator
|
In reply to this post by Peter Kolarov-2
Peter,
This is a known bug: http://forge.objectweb.org/tracker/index.php?func=detail&aid=306407&group_id=168&atid=350207 -Erik Peter Kolarov wrote: > Happy New Year to everyone! > > I believe we have found some OF bug (I am using latest night build) with the > newly added dialog. It seems to break when dialog is called on event > "xforms-ready" - it simply does not show. In the example below you can see > the behavior: > > 1) Dialog is working OK when called in action triggered by submission using > submit button. See this when line <!--xforms:send submission="app-submit" > /--> is commented out. > > 2) Dialog breaks when you remove the comments and try to call the dialog on > xforms-ready event. > > Is there some possible init problem with the dialog or is there another way > to call the dialog during xforms ready action? > > -peter > > > > > <xhtml:html xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:xi="http://www.w3.org/2001/XInclude" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> > <xhtml:head> > <xforms:model> > <xforms:instance id="request"> > <request /> > </xforms:instance> > <xforms:instance id="response"> > <response /> > </xforms:instance> > <xforms:submission method="post" > mediatype="text/xml" replace="instance" > action="http://localhost:8888/test/test" id="app-submit" > ref="instance('request')" instance="response"> > <xforms:action > ev:event="xforms-submit-done"> > <xxforms:show dialog="message-box" > ev:event="DOMActivate" /> > </xforms:action> > </xforms:submission> > <xforms:action ev:event="xforms-ready"> > <!--xforms:send submission="app-submit" /--> > </xforms:action> > </xforms:model> > </xhtml:head> > <xhtml:body> > <xxforms:dialog id="message-box" modal="true" close="true"> > <xforms:label>Test</xforms:label> > <xforms:trigger> > <xforms:label>Close</xforms:label> > <xxforms:hide dialog="message-box" > ev:event="DOMActivate" /> > </xforms:trigger> > </xxforms:dialog> > <xforms:submit submission="app-submit"> > <xforms:label>Submit</xforms:label> > </xforms:submit> > </xhtml:body> > </xhtml:html> 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 |
Administrator
|
In reply to this post by Ryan Puddephatt
Hi Ryan,
On 1/2/07, Ryan Puddephatt <[hidden email]> wrote: > I'm afraid this is the only way to do this, although I believe there was > once talk of a transform attribute on p:inputs, which could be used in a > similar way as it is in the page-flow, but I'm guessing this will now be > decided in the xpl work group If you are referring to the XProc working group, it doesn't seem that we'll have this feature in version 1 of the XProc XML Pipeline Language. You can already see draft of the specification here: http://www.w3.org/TR/xproc/ 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 |
Thanks alex, I'll have a look :-)
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: [hidden email] [mailto:[hidden email]] On Behalf >Of Alessandro Vernet >Sent: 03 January 2007 22:41 >To: [hidden email] >Subject: Re: [ops-users] Usage of xsl:for-each within sql:connection > >Hi Ryan, > >On 1/2/07, Ryan Puddephatt <[hidden email]> wrote: >> I'm afraid this is the only way to do this, although I believe there >> was once talk of a transform attribute on p:inputs, which could be >> used in a similar way as it is in the page-flow, but I'm >guessing this >> will now be decided in the xpl work group > >If you are referring to the XProc working group, it doesn't >seem that we'll have this feature in version 1 of the XProc >XML Pipeline Language. You can already see draft of the >specification here: > >http://www.w3.org/TR/xproc/ > >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 |
Free forum by Nabble | Edit this page |