I know this question will sound like “from the past,” but I need to do this for homework, and I can't get it to work.
The problem is as follows:
I have xml data called from a database, I used xslt to render an xforms document in a browser, by the way, its old firefox 3.6, which was installed only to use the xforms extension. It displays the xforms document correctly, but the controls are not working properly, I cannot submit the form, and also the instance data does not fill in the inputs.
My xsl stylesheet is as follows:
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xf="http://www.w3.org/2002/xforms"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" media-type="application/xhtml+xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" /> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" dir="ltr" lang="es"> <head> <xf:model> <xf:instance> <data xmlns=""> <iCargo_Id>1</iCargo_Id> <sCargo_Desc>lalala</sCargo_Desc> <iConcurrencia_Id>1</iConcurrencia_Id> </data> </xf:instance> <xf:submission id="prueba" action="EditarCargos.aspx" method="post"/> </xf:model> <link href="../css/style.css" rel="stylesheet" type="text/css" /> <title><![CDATA[Adicionar Cargos]]></title> </head> <body> <div class="header"></div> <div class="menu"> <a href="../empleados/editarempleados.aspx"><![CDATA[Empleados]]></a> <a href="../horarios/editarhorarios.aspx"><![CDATA[Horarios]]></a> <a href="../jornadas/editarjornadas.aspx"><![CDATA[Jornadas]]></a> <a href="../cargos/editarcargos.aspx"><![CDATA[Cargos]]></a> <a href="../usuarios/editarusuarios.aspx"><![CDATA[Usuarios]]></a> <a href="../profesiones/editarprofesiones.aspx"><![CDATA[Profesiones]]></a> <a href="../reportes/ReporteMarcaciones.aspx"><![CDATA[Rep. de Marcaciones]]></a> <a href="../cerrarSesion.aspx"><![CDATA[Cerrar Sesión]]></a> </div> <div id="main"> <div class="mainTitle"> <![CDATA[Adicionar Cargos]]> </div> <div> <xf:input ref="sCargo_Desc"> <xf:label><![CDATA[Cargo]]></xf:label> </xf:input> <div> <xf:submit submission="prueba"> <xf:label><![CDATA[Guardar Cambios]]></xf:label> </xf:submit> </div> </div> <div> <a class="cmdSecond" href="EditarCargos.aspx"><![CDATA[Volver]]></a> </div> </div> </body> </html> </xsl:template> <xsl:template match="cargo[iCargo_Id]"> <iCargo_Id> <xsl:value-of select="iCargo_Id"/> </iCargo_Id> <sCargo_Desc> <xsl:value-of select="sCargo_Desc"/> </sCargo_Desc> <iConcurrencia_Id> <xsl:value-of select="iConcurrencia_Id"/> </iConcurrencia_Id> </xsl:template> <xsl:template match="cargo[not(iCargo_Id)]"> <iCargo_Id></iCargo_Id> <sCargo_Desc></sCargo_Desc> <iConcurrencia_Id></iConcurrencia_Id> </xsl:template> </xsl:stylesheet>
and my xml code is as follows:
<cargo> <iCargo_Id>1</iCargo_Id> <sCargo_Desc>Jefe de Sistemas</sCargo_Desc> <iConcurrencia_Id>1</iConcurrencia_Id> </cargo>
I think the problem is with the <xsl:output method="xml" attribute, because xforms requires xhtml rendering, but firefox throws an XSLT exception when I do it.
Please, help! I searched everywhere and I found that it has something with a bug in firefox, but I expect there will be another way to make this work, your help will be greatly appreciated and sorry for my English, I am currently learning: D
jmacboy
source share