Thread: [Xsltforms-support] Problems when using Chrome 34 and Opera 12
Brought to you by:
alain-couthures
From: Mats E. <mat...@ya...> - 2014-05-01 05:47:28
|
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 |
From: Alain C. <ala...@ag...> - 2014-05-04 07:41:27
|
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, > > 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 > > > |
From: Mats E. <mat...@ya...> - 2014-05-04 09:44:34
|
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 <ala...@ag...> To: Mats Eklund <mat...@ya...>; "xsl...@li..." <xsl...@li...> 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, > > >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 > > > > |
From: Mark B. <ma...@te...> - 2014-05-01 09:45:04
|
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-1.0RC@.zip) on Sourceforge is the latest build - we took the files from the repository. HTH Mark Barratt On 1 May 2014, at 06:47, Mats Eklund <mat...@ya...> wrote: > 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 > > > ------------------------------------------------------------------------------ > "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 > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
From: Mats E. <mat...@ya...> - 2014-05-03 06:42:00
|
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 <mat...@ya...> To: "xsl...@li..." <xsl...@li...> 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 |
From: Alain C. <ala...@ag...> - 2014-05-04 08:03:03
|
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, > > 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 E. <mat...@ya...> - 2014-05-04 09:52:43
|
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 <ala...@ag...> To: Mats Eklund <mat...@ya...>; "xsl...@li..." <xsl...@li...> 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, > >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: Alain C. <ala...@ag...> - 2014-05-04 11:21:53
|
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, > > 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: Mats E. <mat...@ya...> - 2014-05-04 13:22:02
|
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 <ala...@ag...> To: Mats Eklund <mat...@ya...>; "xsl...@li..." <xsl...@li...> 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, > >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 C. <ala...@ag...> - 2014-05-04 13:54:35
|
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, > > 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: Mats E. <mat...@ya...> - 2014-06-01 19:23:56
|
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 <ala...@ag...> To: Mats Eklund <mat...@ya...>; "xsl...@li..." <xsl...@li...> 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, > >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 > > |