Hi All !
Can someone suggest me , how do i actually use a <form> tag in an xsl file? In my xsl file, i have two input fields . There is a submit button, and on click of submit button, the xform instance is displayed on the screen.Now , i want to use the values from the xform instance in another jsp. So , i have passed the xform instance as a string to a hidden variable.I have kept a PostXML button in the xsl and I intend to invoke the jsp on its click,and also to retrive the hidden variable in the jsp . In the 'action' attribute of <form> tag , i have specified the path of jsp , but it is not working. I have pasted the code of xsl file here. <!-- Copyright (C) 2004 Orbeon, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. The full text of the license is available at http://www.gnu.org/copyleft/lesser.html --> <xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"> <xhtml:head> <xhtml:title>XForms Text Controls</xhtml:title> </xhtml:head> <form name="NameForm" method="post" action="C:\test\garima.jsp"> <xhtml:body> <xforms:group ref="/masterdatarequest/requestdetails"> <table border="0" cellpadding="10" cellspacing="0"> <tr> <td align="right">MasterId:</td> <td> <xforms:input ref="masterId"> </xforms:input> </td> </tr> <tr> <td align="right">Response Flag:</td> <td> <xforms:input ref="returnResponse"/> </td> </tr> <tr> <td/> <td> <xforms:submit> <xforms:label>Submit</xforms:label> </xforms:submit> </td> </tr> <tr> <td align="right">XForms instance:</td> <td> <f:xml-source> <xsl:copy-of select="/*"/> </f:xml-source> </td> </tr> <tr> <td/> <td> <xforms:submit > <xforms:label> PostXML </xforms:label> </xforms:submit> <input type="hidden" name="HiddenVar" value=' <masterid> {/masterdatarequest/requestdetails/masterId} </masterid> <returnresponse> {/masterdatarequest/requestdetails/returnResponse} </returnresponse> '/> </td> </tr> </table> </xforms:group> </xhtml:body> </form> </xhtml:html> Pls Suggest...!! Thanks in advance!! Regards, Garima -- 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 |
Garima,
You bring up an interesting point - there is no <form> element in XForms, but XForms elements must be enclosed within an <xforms:group> element which is somewhat equivalent. For this reason, some authors suggest that you only have one instance per group, which would make it a very close match for the <form> element in html. XForms submissions are XML documents, and OPS provides the Pageflow Controller (PFC) and pipelines (XPL) to provide a Model-View-Controller mechanism to handle XML within your application. Although I think it is possible to use html forms on a page along with xforms, I think what you want to do is use the <xforms:submission> and <xforms:submit> elements to do the submit work, and that this is less work than trying to manage an XML document using html elements. --Hank Goleta, CA ----- Original Message ----- From: <[hidden email]> To: <[hidden email]> Sent: Wednesday, July 05, 2006 6:54 AM Subject: [ops-users] how to use <form> tag in xsl ? > Hi All ! > > Can someone suggest me , how do i actually use a <form> tag in an xsl file? > In my xsl file, i have two input fields . There is a submit button, and on click of submit button, the xform instance is displayed > on the screen.Now , i want to use the values from the xform instance in another jsp. So , i have passed the xform instance as a > string to a hidden variable.I have kept a PostXML button in the xsl and I intend to invoke the jsp on its click,and also to > retrive the hidden variable in the jsp . > In the 'action' attribute of <form> tag , i have specified the path of jsp , but it is not working. > > I have pasted the code of xsl file here. > <!-- > Copyright (C) 2004 Orbeon, Inc. > > This program is free software; you can redistribute it and/or modify it under the terms of the > GNU Lesser General Public License as published by the Free Software Foundation; either version > 2.1 of the License, or (at your option) any later version. > > This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; > without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > See the GNU Lesser General Public License for more details. > > The full text of the license is available at http://www.gnu.org/copyleft/lesser.html > --> > <xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xsl:version="2.0"> > <xhtml:head> > <xhtml:title>XForms Text Controls</xhtml:title> > </xhtml:head> > > <form name="NameForm" method="post" action="C:\test\garima.jsp"> > > <xhtml:body> > <xforms:group ref="/masterdatarequest/requestdetails"> > <table border="0" cellpadding="10" cellspacing="0"> > <tr> > <td align="right">MasterId:</td> > <td> > <xforms:input ref="masterId"> > </xforms:input> > </td> > </tr> > > <tr> > <td align="right">Response Flag:</td> > <td> > <xforms:input ref="returnResponse"/> > </td> > </tr> > > > <tr> > <td/> > <td> > <xforms:submit> > <xforms:label>Submit</xforms:label> > </xforms:submit> > </td> > </tr> > <tr> > <td align="right">XForms instance:</td> > <td> > <f:xml-source> > <xsl:copy-of select="/*"/> > </f:xml-source> > </td> > </tr> > > > <tr> > <td/> > <td> > <xforms:submit > > <xforms:label> PostXML </xforms:label> > </xforms:submit> > > > <input type="hidden" name="HiddenVar" value=' > <masterid> > {/masterdatarequest/requestdetails/masterId} > </masterid> > <returnresponse> > {/masterdatarequest/requestdetails/returnResponse} > </returnresponse> > '/> > > </td> > </tr> > </table> > </xforms:group> > > </xhtml:body> > </form> > </xhtml:html> > > > Pls Suggest...!! > > Thanks in advance!! > Regards, > Garima > > > > -------------------------------------------------------------------------------- > > -- > 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 |
Free forum by Nabble | Edit this page |