help requested with using Xforms in xslt

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

help requested with using Xforms in xslt

Esealion
Hello

I am trying to construct a xslt stylesheet which contains some xforms, but the forms will not bind to the instance data, and the xforms:repeat is not filled with data from the instance.
I am using some examples I have found online in a attempt to make it work but without any luck. Can anyone help me find the error, or/and point to additional information about how to make it work?

I use firefox 3.5.5 with mozilla xforms 0.8.7pre, and I am trying to transform a xml file using the stylesheet clientside.

xml file
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="phonebook-main.xsl"?>
<Index>

</Index>

xslt file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet  
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:xhtml="http://www.w3.org/1999/xhtml" 
        xmlns:xforms="http://www.w3.org/2002/xforms" 
        xmlns:ev="http://www.w3.org/2001/xml-events"
        exclude-result-prefixes="xhtml xforms ev xlink"
        version="2.0"
>

<xsl:output
        method="xml"
        version="1.0"
        encoding="UTF-8"
        indent="yes"
        omit-xml-decleration="yes"
/>

<xsl:template match="/">
<html>
        <head>
                <title>XForms Example</title>
                <link rel="stylesheet" type="text/css" href="example.css" />
                        <xforms:model id="info" version="1.0">
                                <xforms:instance id="data-instance" xmlns="">
                                        <phoneList>
                                                <person>
                                                        <name>Peggy</name>
                                                        <phone>123</phone>
                                                </person>
  <person>
                                                        <name>Dan</name>
                                                        <nhone>456</nhone>
                                                </person>
                                                <person>
                                                        <name>John</name>
                                                        <phone>789</phone>
                                                        </person>
                                                <person>
                                                        <name>Sue</name>
                                                        <phone>234</phone>
                                                </person>
                                                <newperson>
                                                        <name/>
                                                        <phone/>
  </newperson>
  <selectedrow/>
                                        </phoneList>
                                </xforms:instance>
                                <xforms:bind nodeset="phonelist" id="persondata" />
                        </xforms:model>
        </head>
        <body>
          <xforms:group bind="persondata" model="info">
          <fieldset>
            <legend>Phone List</legend>
            <xforms:repeat id="person-repeat" nodeset="person">
              <xforms:input ref="name" />
              <xforms:input ref="phone" />
         </xforms:repeat>
      </fieldset>
      </xforms:group>
   </body>
</html>
</xsl:template>
</xsl:stylesheet>

Best regards
E
Reply | Threaded
Open this post in threaded view
|

Re: help requested with using Xforms in xslt

rmaw
On Nov 8, 7:04 am, Esealion <[hidden email]> wrote:
> Hello
>
> I use firefox 3.5.5 with mozilla xforms 0.8.7pre, and I am trying to
> transform a xml file using the stylesheet clientside.

It would be really handy if this was possible but last I heard you
have to do the XSL transformation server-side. You are not the first
person who has wanted to do this but there is some bug or trouble with
the way code is structured in the Mozilla code base that prevents this
from being possible. That's what I have heard, at least.

- mawrya
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: help requested with using Xforms in xslt

Esealion
Thank you for your reply.

I have investigated, and comes to the same conclusion, that a error in firefox at present makes client-side transformation like the one I described impossible.

Investigating serverside transformation, I am wondering which method is best using a Apache server under the conditions, that I want the transformation to happend dynamically when the user access the page, and I would like xslt2 to be supported.

Anyone has any recommendation along with a good tutorial detailing how to set it up and executing it?

Best regards
E

rmaw wrote
On Nov 8, 7:04 am, Esealion <relaxc...@gmail.com> wrote:
> Hello
>
> I use firefox 3.5.5 with mozilla xforms 0.8.7pre, and I am trying to
> transform a xml file using the stylesheet clientside.

It would be really handy if this was possible but last I heard you
have to do the XSL transformation server-side. You are not the first
person who has wanted to do this but there is some bug or trouble with
the way code is structured in the Mozilla code base that prevents this
from being possible. That's what I have heard, at least.

- mawrya
_______________________________________________
dev-tech-xforms mailing list
dev-tech-xforms@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: help requested with using Xforms in xslt

Philipp Wagner-4
In reply to this post by rmaw
On 14.11.2009 12:49, Esealion wrote:
>
> Thank you for your reply.
>
> I have investigated, and comes to the same conclusion, that a error in
> firefox at present makes client-side transformation like the one I described
> impossible.

yes, that's how it is (see bug #294612 [1])

> Investigating serverside transformation, I am wondering which method is best
> using a Apache server under the conditions, that I want the transformation
> to happend dynamically when the user access the page, and I would like xslt2
> to be supported.
>
> Anyone has any recommendation along with a good tutorial detailing how to
> set it up and executing it?

For XSLT 1 there is mod-xslt2 [2] (the name does not hold what it
suggests).
The XSLT 2 requirement pretty much leaves you with Saxon, for which I
don't know an Apache module. Saxon is written in Java, so the best way
would probably be writing a small servlet to do the transformation. I
did something like that in PHP using the PHP/Java bridge [3]. It works
well and it's fast, but the whole setup takes some time to get right
(the PHP/Java bridge documentation is a mess ...)

Philipp

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=294612
[2] http://www.mod-xslt2.com/
[3] http://php-java-bridge.sourceforge.net/pjb/
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: help requested with using Xforms in xslt

piotr-28
In reply to this post by rmaw
On 14 ноя, 01:43, mawrya <[hidden email]> wrote:

> On Nov 8, 7:04 am, Esealion <[hidden email]> wrote:
>
> > Hello
>
> > I use firefox 3.5.5 with mozilla xforms 0.8.7pre, and I am trying to
> > transform a xml file using the stylesheet clientside.
>
> It would be really handy if this was possible but last I heard you
> have to do the XSL transformation server-side. You are not the first
> person who has wanted to do this but there is some bug or trouble with
> the way code is structured in the Mozilla code base that prevents this
> from being possible. That's what I have heard, at least.
>
> - mawrya

method="xhml"
Firefox/3.0.15
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: help requested with using Xforms in xslt

Esealion

When I try to change method from xml to xhtml I get a error parsing stylesheet. Do I need to add additional conditions to get the xhtml to work?

The stylesheet has this output layout after change
<xsl:output
       method="xhtml"
       version="1.0"
       encoding="UTF-8"
       indent="yes"
       omit-xml-decleration="yes"
/>

Changing from xhtml back to xml removes the parsing error, but then the form is not filled with data.
I use firefox 3.5.5 with mozilla xforms 0.8.7pre



piotr-28 wrote

method="xhml"
Firefox/3.0.15
_______________________________________________
dev-tech-xforms mailing list
dev-tech-xforms@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: help requested with using Xforms in xslt

Betty Harvey
The word 'decleration' is spelled wrong.  It should be:

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

That may be the problem.

Good luck!

Betty

>
>
> When I try to change method from xml to xhtml I get a error parsing
> stylesheet. Do I need to add additional conditions to get the xhtml to
> work?
>
> The stylesheet has this output layout after change
> <xsl:output
>        method="xhtml"
>        version="1.0"
>        encoding="UTF-8"
>        indent="yes"
>        omit-xml-decleration="yes"
> />
>
> Changing from xhtml back to xml removes the parsing error, but then the
> form
> is not filled with data.
> I use firefox 3.5.5 with mozilla xforms 0.8.7pre
>
>
>
>
> piotr-28 wrote:
>>
>>
>>
>> method="xhml"
>> Firefox/3.0.15
>> _______________________________________________
>> dev-tech-xforms mailing list
>> [hidden email]
>> https://lists.mozilla.org/listinfo/dev-tech-xforms
>>
>>
>
> --
> View this message in context:
> http://old.nabble.com/help-requested-with-using-Xforms-in-xslt-tp26254218p26465164.html
> Sent from the Mozilla - XForms mailing list archive at Nabble.com.
>
> _______________________________________________
> dev-tech-xforms mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xforms
>


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Betty Harvey                         | Phone: 410-787-9200 FAX: 9830
Electronic Commerce Connection, Inc. |
[hidden email]                    | Washington,DC XML Users Grp
URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: help requested with using Xforms in xslt

Esealion
changing the spelling error unfortunately did not do the trick either. I submit the top of the xlst file for any guidance you can give to get it to work:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns="http://www.w3.org/1999/xhtml"
       xmlns:xhtml="http://www.w3.org/1999/xhtml"
       xmlns:xforms="http://www.w3.org/2002/xforms"
       xmlns:ev="http://www.w3.org/2001/xml-events"
       exclude-result-prefixes="xhtml xforms ev"
       version="2.0"
>

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



Betty Harvey wrote
The word 'decleration' is spelled wrong.  It should be:

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

That may be the problem.

Good luck!

Betty

>
>
> When I try to change method from xml to xhtml I get a error parsing
> stylesheet. Do I need to add additional conditions to get the xhtml to
> work?
>
> The stylesheet has this output layout after change
> <xsl:output
>        method="xhtml"
>        version="1.0"
>        encoding="UTF-8"
>        indent="yes"
>        omit-xml-decleration="yes"
> />
>
> Changing from xhtml back to xml removes the parsing error, but then the
> form
> is not filled with data.
> I use firefox 3.5.5 with mozilla xforms 0.8.7pre
>
>
>
>
> piotr-28 wrote:
>>
>>
>>
>> method="xhml"
>> Firefox/3.0.15
>> _______________________________________________
>> dev-tech-xforms mailing list
>> dev-tech-xforms@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-tech-xforms
>>
>>
>
> --
> View this message in context:
> http://old.nabble.com/help-requested-with-using-Xforms-in-xslt-tp26254218p26465164.html
> Sent from the Mozilla - XForms mailing list archive at Nabble.com.
>
> _______________________________________________
> dev-tech-xforms mailing list
> dev-tech-xforms@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-xforms
>


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Betty Harvey                         | Phone: 410-787-9200 FAX: 9830
Electronic Commerce Connection, Inc. |
harvey@eccnet.com                    | Washington,DC XML Users Grp
URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
_______________________________________________
dev-tech-xforms mailing list
dev-tech-xforms@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: help requested with using Xforms in xslt

rmaw
In reply to this post by Betty Harvey
Mozilla does not support XSLT version="2.0" nor output method="xhtml".
Stick with 1.0 and xml or do the transformation on the server side
with an XSLT engine that does support 2.0 (Saxon, etc.)

- mawrya


> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet
>        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>        xmlns="http://www.w3.org/1999/xhtml"
>        xmlns:xhtml="http://www.w3.org/1999/xhtml"
>        xmlns:xforms="http://www.w3.org/2002/xforms"
>        xmlns:ev="http://www.w3.org/2001/xml-events"
>        exclude-result-prefixes="xhtml xforms ev"
>        version="2.0"
>
>
>
> <xsl:output
>        method="xhtml"
>        version="1.0"
>        encoding="UTF-8"
>        indent="yes"
>        omit-xml-declaration="yes"
> />
>
>

> >> When I try to change method from xml to xhtml I get a error parsing
> >> stylesheet. Do I need to add additional conditions to get the xhtml to
> >> work?

> >> Changing from xhtml back to xml removes the parsing error, but then the
> >> form
> >> is not filled with data.
> >> I use firefox 3.5.5 with mozilla xforms 0.8.7pre
>


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: help requested with using Xforms in xslt

dr.cw.ray
On Nov 24, 2:06 am, mawrya <[hidden email]> wrote:

> Mozilla does not support XSLT version="2.0" nor output method="xhtml".
> Stick with 1.0 and xml or do the transformation on the server side
> with an XSLT engine that does support 2.0 (Saxon, etc.)
>
> - mawrya
>
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet
> >        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >        xmlns="http://www.w3.org/1999/xhtml"
> >        xmlns:xhtml="http://www.w3.org/1999/xhtml"
> >        xmlns:xforms="http://www.w3.org/2002/xforms"
> >        xmlns:ev="http://www.w3.org/2001/xml-events"
> >        exclude-result-prefixes="xhtml xforms ev"
> >        version="2.0"
>
> > <xsl:output
> >        method="xhtml"
> >        version="1.0"
> >        encoding="UTF-8"
> >        indent="yes"
> >        omit-xml-declaration="yes"
> > />
>
> > >> When I try to change method from xml to xhtml I get a error parsing
> > >> stylesheet. Do I need to add additional conditions to get the xhtml to
> > >> work?
> > >> Changing from xhtml back to xml removes the parsing error, but then the
> > >> form
> > >> is not filled with data.
> > >> I use firefox 3.5.5 with mozilla xforms 0.8.7pre

I'm a bit late on this, but if you're really into xslt, then try
looking at XSLTForms and some of the simpler examples . This can show
you how to use xforms and xslt together even if you dont't actually
use the XSLTForms engine (you can look at how the structure of the
client-side and server-side documents are set-up).
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms