W3C home > Mailing lists > Public > www-forms@w3.org > December 2007

embedding an XForms in XSLT

From: <d9357014@est.fib.upc.edu>
Date: Tue, 11 Dec 2007 19:36:07 +0100
Message-ID: <20071211193607.5g8hoz5hno8ssokc@webmail.fib.upc.es>
To: www-forms@w3.org


   I try to include an XForms in a code XSLT, and send it to Firefox  
to transform it.

   I give you a simple example:

   File prueba.xml contain trivial information...

   File prueba.xsl include model in 'head' section, and a basic  
'input' and 'submit' in body section.

   -----------------------------------------

   prueba.xml

   ------------------------------------------

   <?xml version="1.0" encoding='ISO-8859-1'?>
<?xml-stylesheet href="prueba.xsl" type="text/xsl"?>
<prueba>
  <nombre>Processing an XForms in XSLT</nombre>
  <contacto>999 99 99 99 </contacto>
</prueba>

   ------------------------------------------

   prueba.xsl

   ------------------------------------------

   <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"  
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
xmlns:xf="http://www.w3.org/2002/xforms"  >

<xsl:output method="xml" version="2.0" encoding="UTF-8" indent="no"
omit-xml-declaration="yes"/>

<xsl:template match='/'>
  <html xmlns="http://www.w3.org/1999/xhtml"  
xmlns:xf="http://www.w3.org/2002/xforms" >
 <meta content="application/xhtml+xml; charset=ISO-8859-1"  
http-equiv="content-type"/>
    <head>
        <title>Generado con prueba.xsl</title>
                <xf:model id="datos">
                        <xf:instance xmlns="">
                                <data>
                                        <nom>Rafa</nom>
                                </data>
                        </xf:instance>
                        <xf:submission action="http://localhost"
                        method="get"
                        id="formulari"/>
                </xf:model>

    </head>
    <body>
        <xsl:copy-of select='.'/>
        <h1> <xsl:apply-templates /> </h1>
        <xf:input ref="nom" model="datos">
                <xf:label>Propietario:<br/></xf:label>
        </xf:input>
        <xf:submit  
submission="formulari"><xf:label>Busca</xf:label></xf:submit>
    </body>
  </html>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------

   I process with xsltproc:

   > xsltproc -o prueba.xhtml  prueba.xml

   If I try to open file prueba.xhtml with Firefox, i can see the  
format of XFORMS.

   But... If i try to open prueba.xml with Firefox, model XForms is  
not recognized. Then, information in <nom> is not displayed in input  
XForms. And submission button not send you to anywhere...

   It is possible embedd XForms in XSLT? Or exists any problem with  
Firefox to understand this?

   It is only an example, but it is sufficient to explain problems i  
have to embedd XForms in a XSLT.

   I hope you see that it works well if we use before xsltproc to  
create an XHTML file. But Firefox can't do it, or not understand de  
XFORMS model into <stylesheet>.

   Note: sorry, i don't write good English language...
Received on Wednesday, 12 December 2007 20:05:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:11 GMT