Discussion:
Problems when using Chrome 34 and Opera 12
Mats Eklund
2014-05-01 05:47:21 UTC
Permalink
Hi Alain and others,


I am just beginning to try XsltForms, and am having problems opening my first form in Chrome (v34) and in Opera (v12.17) getting the following error messages:


Chrome error on loading form:

Javscript Alert
XSLTForms Exception
Error dispatching event 'xforms-model-construct'
TypeError: undefined is not a function

 at Object.XsltForms_browser.getMeta(...xsltforms.js: 1083:474)
 at XsltForms_coreElement.XsltForms_instance.validate_(...xsltforms.js:7114:34)
....
TypeError
undefined is not a function

 
Opera error on loading form:
File not found: file://localhost/C:/.../xsltforms/config_en.xsl
and subsequently
XSLTForms Exception
Error initializing:
<anonymous function: XsltForms_browser.loadNode>([arguments not available])@file://localhost/.../xsltforms.js:894
...
TypeError
Cannot convert 'src' to object


Are these known problems, and is there a solution? The form loads fine in Firefox!


Thanks for your support!

Mats
Mark Barratt
2014-05-01 09:45:19 UTC
Permalink
Mats

We saw the Chrome problems on the release of Chrome 34 and fixed them by using build 594 - a further problem that we weren’t seeing was fixed by Alain in build 595 (on the source forge site at http://sourceforge.net/p/xsltforms).

The new code is also giving us no errors in Opera 12.

Not sure if the bundled download (xslt-forms-***@.zip) on Sourceforge is the latest build - we took the files from the repository.

HTH

Mark Barratt
Post by Mats Eklund
Hi Alain and others,
Javscript Alert
XSLTForms Exception
Error dispatching event 'xforms-model-construct'
TypeError: undefined is not a function
at Object.XsltForms_browser.getMeta(...xsltforms.js: 1083:474)
at XsltForms_coreElement.XsltForms_instance.validate_(...xsltforms.js:7114:34)
....
TypeError
undefined is not a function
File not found: file://localhost/C:/.../xsltforms/config_en.xsl
and subsequently
XSLTForms Exception
...
TypeError
Cannot convert 'src' to object
Are these known problems, and is there a solution? The form loads fine in Firefox!
Thanks for your support!
Mats
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs_______________________________________________
Xsltforms-support mailing list
https://lists.sourceforge.net/lists/listinfo/xsltforms-support
Mats Eklund
2014-05-03 06:41:53 UTC
Permalink
Hi,

I am experimenting with the idea to be able to open an instance data document in the browser and have it load with an associated xforms document. I am thinking this could be done using a 2-stage XSLT transformation, where the first transformation inserts the opened instance data document into the default data instance of its associated xforms document (specified as a parameter in a processing instruction), and then let the resulting document be the input for the second transformation - the XsltForms stylesheet - to have the form rendered in the browser.

Does the XsltForms stylesheet has any provisions for this approach already? I was able to achieve the desired result by rewriting some of the templates and xpath expressions in the xsltforms stylesheet (including rewiring references to root node to root node of the result document of the first transformation), but would prefer not to do much changes to the XsltForms stylesheet.

Kind regards,
Mats




________________________________
From: Mats Eklund <mats.eklund-/***@public.gmane.org>
To: "xsltforms-support-5NWGOfrQmneRv+***@public.gmane.org" <xsltforms-support-5NWGOfrQmneRv+***@public.gmane.org>
Sent: Thursday, May 1, 2014 7:47 AM
Subject: Problems when using Chrome 34 and Opera 12



Hi Alain and others,


I am just beginning to try XsltForms, and am having problems opening my first form in Chrome (v34) and in Opera (v12.17) getting the following error messages:


Chrome error on loading form:

Javscript Alert
XSLTForms Exception
Error dispatching event 'xforms-model-construct'
TypeError: undefined is not a function

 at Object.XsltForms_browser.getMeta(...xsltforms.js: 1083:474)
 at XsltForms_coreElement.XsltForms_instance.validate_(...xsltforms.js:7114:34)
....
TypeError
undefined is not a function

 
Opera error on loading form:
File not found: file://localhost/C:/.../xsltforms/config_en.xsl
and subsequently
XSLTForms Exception
Error initializing:
<anonymous function: XsltForms_browser.loadNode>([arguments not available])@file://localhost/.../xsltforms.js:894
...
TypeError
Cannot convert 'src' to object


Are these known problems, and is there a solution? The form loads fine in Firefox!



Thanks for your support!

Mats
Alain Couthures
2014-05-04 08:02:55 UTC
Permalink
Hi Mats,

Yes, XSLTForms stylesheet is looking for a processing instruction to
load a specified form with the associated instance as the default one
(http://lists.w3.org/Archives/Public/public-forms/2011Oct/0026.html).
So, 2 processing instructions are required: one for xsltforms.xsl, one
for the form to be loaded.

Unfortunately, document() use is locally forbidden in Chrome, native
XSLT support is compromised in future browser versions... As a
workaround for XSLTFoms 2.0, the SCRIPT HTML element seems to be the
unique possibility to emulate processing instructions (the instance
should be embedded into a script/@type="text/xml" element).

Thank you for your feedback!

-Alain
Post by Mats Eklund
Hi,
I am experimenting with the idea to be able to open an instance data
document in the browser and have it load with an associated xforms
document. I am thinking this could be done using a 2-stage XSLT
transformation, where the first transformation inserts the opened
instance data document into the default data instance of its
associated xforms document (specified as a parameter in a processing
instruction), and then let the resulting document be the input for the
second transformation - the XsltForms stylesheet - to have the form
rendered in the browser.
Does the XsltForms stylesheet has any provisions for this approach
already? I was able to achieve the desired result by rewriting some of
the templates and xpath expressions in the xsltforms stylesheet
(including rewiring references to root node to root node of the result
document of the first transformation), but would prefer not to do much
changes to the XsltForms stylesheet.
Kind regards,
Mats
Mats Eklund
2014-05-04 09:52:36 UTC
Permalink
Hi Alain,

I tried the ?xml-form approach, however, the resulting page is an XSLTForms Profiler page rather than the form!? Am I doing something wrong then?

My xml file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<?xml-form type="application/xhtml+xml" href="myform.xhtml" instance="data"?>
<data>...</data>

Kind regards,
Mats


PS. Pity that native XML standards support seems to be degrading in browsers...



________________________________
From: Alain Couthures <alain.couthures-g9Gpw7ZaukQS+***@public.gmane.org>
To: Mats Eklund <***@yahoo.com>; "xsltforms-support-5NWGOfrQmneRv+***@public.gmane.org" <xsltforms-support-5NWGOfrQmneHXe+***@public.gmane.orgrceforge.net>
Sent: Sunday, May 4, 2014 10:02 AM
Subject: Re: [Xsltforms-support] Booting XsltForms from an instance data document



Hi Mats,

Yes, XSLTForms stylesheet is looking for a processing instruction
to load a specified form with the associated instance as the
default one
(http://lists.w3.org/Archives/Public/public-forms/2011Oct/0026.html). So, 2 processing instructions are required: one for xsltforms.xsl, one for the form to be loaded.

Unfortunately, document() use is locally forbidden in Chrome,
native XSLT support is compromised in future browser versions...
As a workaround for XSLTFoms 2.0, the SCRIPT HTML element seems to
be the unique possibility to emulate processing instructions (the
instance should be embedded into a script/@type="text/xml"
element).

Thank you for your feedback!

-Alain


Le 03/05/2014 08:41, Mats Eklund a écrit :

Hi,
Post by Mats Eklund
I am experimenting with the idea to be able to open an instance
data document in the browser and have it load with an associated
xforms document. I am thinking this could be done using a
2-stage XSLT transformation, where the first transformation
inserts the opened instance data document into the default data
instance of its associated xforms document (specified as a
parameter in a processing instruction), and then let the
resulting document be the input for the second transformation -
the XsltForms stylesheet - to have the form rendered in the
browser.
Post by Mats Eklund
Does the XsltForms stylesheet has any provisions for this
approach already? I was able to achieve the desired result by
rewriting some of the templates and xpath expressions in the
xsltforms stylesheet (including rewiring references to root node
to root node of the result document of the first
transformation), but would prefer not to do much changes to the
XsltForms stylesheet.
Post by Mats Eklund
Kind regards,
Mats
Alain Couthures
2014-05-04 11:21:41 UTC
Permalink
Hi Mats,

Because the document() function is not allowed by Chrome, I had to force
the Profiler into the stylesheet itself...

Could please you try with another browser?

Is it an important feature for you? This could be rewritten with
Javascript (and native XSLT engine launched with Javascript). What do
you think?

Thanks!

-Alain
Post by Mats Eklund
Hi Alain,
I tried the ?xml-form approach, however, the resulting page is an
XSLTForms Profiler page rather than the form!? Am I doing something
wrong then?
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<?xml-form type="application/xhtml+xml" href="myform.xhtml"
instance="data"?>
<data>...</data>
Kind regards,
Mats
PS. Pity that native XML standards support seems to be degrading in browsers...
------------------------------------------------------------------------
Mats Eklund
2014-05-04 13:21:55 UTC
Permalink
Hi Alain,

I have managed to implement the javascript approach, and it works, so I have a fallback solution.

Meanwhile I was able to resolve the (first) problem with the ?xml-form approach: I realized that the ?xml-form/@href of the form had to be relative to the XSLTForms XSL document rather than the source XML document. Now I however get a javascript exception at line 9455 in xsltforms.js. Consistent behavior in all browsers. If I open the referenced form directly (with same instance data), it loads without problem.

Any idea what this could be, or how to best troubleshoot?

Kind regards,
Mats




________________________________
From: Alain Couthures <alain.couthures-g9Gpw7ZaukQS+***@public.gmane.org>
To: Mats Eklund <mats.eklund-/***@public.gmane.org>; "xsltforms-support-5NWGOfrQmneRv+***@public.gmane.org" <xsltforms-support-5NWGOfrQmneRv+***@public.gmane.org>
Sent: Sunday, May 4, 2014 1:21 PM
Subject: Re: [Xsltforms-support] Booting XsltForms from an instance data document



Hi Mats,

Because the document() function is not allowed by Chrome, I had to
force the Profiler into the stylesheet itself...

Could please you try with another browser?

Is it an important feature for you? This could be rewritten with
Javascript (and native XSLT engine launched with Javascript). What
do you think?

Thanks!

-Alain


Le 04/05/2014 11:52, Mats Eklund a écrit :

Hi Alain,
Post by Mats Eklund
I tried the ?xml-form approach, however, the resulting page is
an XSLTForms Profiler page rather than the form!? Am I doing
something wrong then?
Post by Mats Eklund
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="xsltforms/xsltforms.xsl"
type="text/xsl"?>
Post by Mats Eklund
<?xml-form type="application/xhtml+xml" href="myform.xhtml"
instance="data"?>
Post by Mats Eklund
<data>...</data>
Kind regards,
Mats
PS. Pity that native XML standards support seems to be degrading in browsers...
________________________________
Alain Couthures
2014-05-04 13:54:18 UTC
Permalink
Hi Mats,

At line 9455, an exception occurs when an id for an XForms element is
not found. This consistency issue might be due to an invalid id
generation during the XSLT transformation.

-Alain
Post by Mats Eklund
Hi Alain,
I have managed to implement the javascript approach, and it works, so
I have a fallback solution.
Meanwhile I was able to resolve the (first) problem with the ?xml-form
relative to the XSLTForms XSL document rather than the source XML
document. Now I however get a javascript exception at line 9455 in
xsltforms.js. Consistent behavior in all browsers. If I open the
referenced form directly (with same instance data), it loads without
problem.
Any idea what this could be, or how to best troubleshoot?
Kind regards,
Mats
Mats Eklund
2014-06-01 19:23:47 UTC
Permalink
Hi Alain,

Ok, I investigated the issue and found that things work after the following changes in xsltforms.xsl:

* On line 63, change <xsl:apply-templates select="$piformdoc/*" mode="script"/> to <xsl:apply-templates select="$piformdoc" mode="script"/> (This fixes the id mismatches)
* On lines 51, 52 and 56 (x2), change "$piform" to "concat(' ', $piform)" (This fixes a problem that xsltforms does not recognize all parameters set on the xml-forms processing instruction)

Hope these fixes can be incorporated into the official source.

Kind regards,
Mats


________________________________
From: Alain Couthures <***@agencexml.com>
To: Mats Eklund <mats.eklund-/***@public.gmane.org>; "xsltforms-***@lists.sourceforge.net" <xsltforms-support-5NWGOfrQmneRv+***@public.gmane.org>
Sent: Sunday, May 4, 2014 3:54 PM
Subject: Re: [Xsltforms-support] Booting XsltForms from an instance data document



Hi Mats,

At line 9455, an exception occurs when an id for an XForms element
is not found. This consistency issue might be due to an invalid id
generation during the XSLT transformation.

-Alain


Le 04/05/2014 15:21, Mats Eklund a écrit :

Hi Alain,
Post by Mats Eklund
I have managed to implement the javascript approach, and it
works, so I have a fallback solution.
Post by Mats Eklund
Meanwhile I was able to resolve the (first) problem with the
?xml-form approach: I realized that the ?xml-form/@href of the
form had to be relative to the XSLTForms XSL document rather
than the source XML document. Now I however get a javascript
exception at line 9455 in xsltforms.js. Consistent behavior in
all browsers. If I open the referenced form directly (with same
instance data), it loads without problem.
Post by Mats Eklund
Any idea what this could be, or how to best troubleshoot?
Kind regards,
Mats
Alain Couthures
2014-05-04 07:28:19 UTC
Permalink
Hi Mats,

I suspect that this is not the same issue with Chrome and with Opera.

Chrome 34 has anticipated DOM4: attributes are not nodes anymore, it is
not possible to get the corresponding owner element, namespace
declarations are treated as regular attributes,... Latest revision of
XSLTForms, only in source repositories, has some workarounds for this.
At least, there is no exception...

Opera does not allow loading of local XSLT stylesheet (with file://
protocol). It sounds to be a security restriction but other browser
vendors don't seem to follow this...

Actually, the use of native implementations of W3C standards in
XSLTForms is a weak point: Google team is eager to remove its XSLT
engine from Chrome, DOM4 is lighter than DOM3 and is not enough for full
XML processing. I am currently working on XSLTForms 2.0: it will have
its own Javascript DOM3 implementation and it will support
Javascript-only form loading as a full polyfill.

So, these issues should not be possible with future versions of XSLTForms.

What do you think?

-Alain
Post by Mats Eklund
Hi Alain and others,
I am just beginning to try XsltForms, and am having problems opening
my first form in Chrome (v34) and in Opera (v12.17) getting the
Javscript Alert
XSLTForms Exception
Error dispatching event 'xforms-model-construct'
TypeError: undefined is not a function
at Object.XsltForms_browser.getMeta(...xsltforms.js: 1083:474)
at
XsltForms_coreElement.XsltForms_instance.validate_(...xsltforms.js:7114:34)
....
TypeError
undefined is not a function
File not found: file://localhost/C:/.../xsltforms/config_en.xsl
and subsequently
XSLTForms Exception
<anonymous function: XsltForms_browser.loadNode>([arguments not
...
TypeError
Cannot convert 'src' to object
Are these known problems, and is there a solution? The form loads fine in Firefox!
Thanks for your support!
Mats
Mats Eklund
2014-05-04 09:44:26 UTC
Permalink
Thanks Alain,

I downloaded latest revision and got it working in Chrome 34!

I think your approach makes sense, however, I think it is a pity that the only way of loading would be via Javascript and not via the XML processing instruction.

Kind regards,
Mats




________________________________
From: Alain Couthures <alain.couthures-***@public.gmane.orgm>
To: Mats Eklund <mats.eklund-/***@public.gmane.org>; "xsltforms-support-***@public.gmane.orgceforge.net" <xsltforms-support-5NWGOfrQmneRv+***@public.gmane.org>
Sent: Sunday, May 4, 2014 9:28 AM
Subject: Re: [Xsltforms-support] Problems when using Chrome 34 and Opera 12



Hi Mats,

I suspect that this is not the same issue with Chrome and with
Opera.

Chrome 34 has anticipated DOM4: attributes are not nodes anymore,
it is not possible to get the corresponding owner element,
namespace declarations are treated as regular attributes,...
Latest revision of XSLTForms, only in source repositories, has
some workarounds for this. At least, there is no exception...

Opera does not allow loading of local XSLT stylesheet (with file:// protocol). It sounds to be a security restriction but other browser vendors don't seem to follow this...

Actually, the use of native implementations of W3C standards in
XSLTForms is a weak point: Google team is eager to remove its XSLT
engine from Chrome, DOM4 is lighter than DOM3 and is not enough
for full XML processing. I am currently working on XSLTForms 2.0:
it will have its own Javascript DOM3 implementation and it will
support Javascript-only form loading as a full polyfill.

So, these issues should not be possible with future versions of
XSLTForms.

What do you think?

-Alain

Le 01/05/2014 07:47, Mats Eklund a écrit :

Hi Alain and others,
Post by Mats Eklund
Javscript Alert
XSLTForms Exception
Error dispatching event 'xforms-model-construct'
TypeError: undefined is not a function
 at Object.XsltForms_browser.getMeta(...xsltforms.js: 1083:474)
 at
XsltForms_coreElement.XsltForms_instance.validate_(...xsltforms.js:7114:34)
Post by Mats Eklund
....
TypeError
undefined is not a function
 
File not found: file://localhost/C:/.../xsltforms/config_en.xsl
and subsequently
XSLTForms Exception
...
TypeError
Cannot convert 'src' to object
Are these known problems, and is there a solution? The form loads fine in Firefox!
Thanks for your support!
Mats
Loading...