Thread: [Xsltforms-support] When external schema defined, FF cannot see primitive xsd types
Brought to you by:
alain-couthures
From: Kostis A. <ank...@gm...> - 2010-03-29 14:26:33
Attachments:
externalSchema.xml
xsd.xml
|
On FF, when an external schema is defined, xf:bind elements with 'type' attributes having xsd-types, i.e. "xsd:string, xsd:integer" fail to work, and the form on initialization complains about these types with a «Schema for namespace '' not defined for type string» msg. (or "Schema not defined" on older revisions) - On Chrome and (i think?) IE external schemas work OK. - I didn't manage to determine exactly the revision this behavior was introduced. The beta-2(rev260) release, on FF, although it did not work always quite-well with external schemas, it did *not* produce the err msg, and the attached-here test-case xform works indeed correctly. On rev262, the msg emerges on init, and the xsd-types ceases to work. I include below a test-case reproducing the error, also attached as separate files. Regards, Kostis Anagnostopoulos XForms file: -------------------- <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" encoding="UTF-8" type="text/xsl"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:data="http://some-uri.org/data" > <head> <title>external-schema</title> <xf:model id="model-main" schema="xsd.xml"> <xf:instance id="inst-main" > <data:root> <data:item /> <data:otherItem /> </data:root> </xf:instance> <xf:bind id="bind-item" nodeset="/data:root/data:item" type="data:Route" /> <xf:bind id="bind-otherItem" nodeset="/data:root/data:otherItem" type="xsd:string" /> </xf:model> </head> <body> Item: <xf:input bind="bind-item" incremental="true" /> OtherItem: <xf:input bind="bind-otherItem" incremental="true" /> </body> </html> XSD file: -------------------- <?xml version="1.0" encoding="UTF-8"?> <xsd:schema elementFormDefault="unqualified" attributeFormDefault="unqualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:data="http://some-uri.org/data" targetNamespace="http://some-uri.org/data" > <xsd:simpleType name="someInt"> <xsd:restriction base="xsd:integer"> </xsd:restriction> </xsd:simpleType> </xsd:schema> exa |
From: COUTHURES A. <ala...@ag...> - 2010-03-29 18:03:07
|
Kostis, > On FF, when an external schema is defined, xf:bind elements with > 'type' attributes having xsd-types, > i.e. "xsd:string, xsd:integer" fail to work, > and the form on initialization complains about these types with a > «Schema for namespace '' not defined for type string» msg. > (or "Schema not defined" on older revisions) > FF doesn't support namespace:: axis and this is awful in many situations. I have implemented workarounds for that but they are not perfect yet and I'm not sure it's possible anyhow. This has been improved and committed. > The beta-2(rev260) release, on FF, although it did not work always > quite-well with external schemas, > it did *not* produce the err msg, and the attached-here test-case > xform works indeed correctly. > On rev262, the msg emerges on init, and the xsd-types ceases to work. > beta-3 needs testing... Thank for your help! -Alain |
From: Grégoire C. <gco...@gm...> - 2010-03-29 21:58:39
|
COUTHURES Alain a écrit : > FF doesn't support namespace:: axis and this is awful in many situations. > BTW, could everyone vote for this bug : https://bugzilla.mozilla.org/show_bug.cgi?id=94270 > I have implemented workarounds for that but they are not perfect yet and > I'm not sure it's possible anyhow. > I'm not sure if this is exactly the same error I had weeks ago, but Kostis, maybe you should try to declare your own namespace in <html> and use it right away with a bogus attribute, as in the two last lines here with the "my" prefix : <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:my="http://www.myowndomain.com" my:workaroundForFirefoxBug="https://bugzilla.mozilla.org/show_bug.cgi?id=94270" > Grégoire |
From: Kostis A. <ank...@gm...> - 2010-03-30 00:49:49
|
2010/3/29 Grégoire COLBERT <gco...@gm...>: > COUTHURES Alain a écrit : >> FF doesn't support namespace:: axis and this is awful in many situations. >> > BTW, could everyone vote for this bug : > > https://bugzilla.mozilla.org/show_bug.cgi?id=94270 Voted for it! >> I have implemented workarounds for that but they are not perfect yet and >> I'm not sure it's possible anyhow. >> > I'm not sure if this is exactly the same error I had weeks ago, but > Kostis, maybe you should try to declare your own namespace in <html> and > use it right away with a bogus attribute, as in the two last lines here > with the "my" prefix : > > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xf="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:my="http://www.myowndomain.com" > > my:workaroundForFirefoxBug="https://bugzilla.mozilla.org/show_bug.cgi?id=94270" >> Grégoire, i did not understand where or why should i use your workaround - probably you did not understand the problem i presented in the fist place. And not to be faulted, since the xform file i sent had an error that prevented you from trying it, to see the error for yourself. For reference, i'm re-sending it, corrected: (the xsd.xml file remains unchanged) ------------------- <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="xsltforms/xsltforms.xsl" encoding="UTF-8" type="text/xsl"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:data="http://some-uri.org/data" > <head> <title>external-schema</title> <xf:model id="model-main" schema="xsd.xml"> <xf:instance id="inst-main" > <data:root> <data:item /> <data:otherItem /> </data:root> </xf:instance> <xf:bind id="bind-item" nodeset="/data:root/data:item" type="data:someInt" /> <xf:bind id="bind-otherItem" nodeset="/data:root/data:otherItem" type="xsd:integer" /> </xf:model> </head> <body> Item: <xf:input bind="bind-item" incremental="true" /> OtherItem: <xf:input bind="bind-otherItem" incremental="true" /> </body> </html> |
From: Grégoire C. <gco...@gm...> - 2010-03-30 08:16:49
|
Hi Kostis, Kostis Anagnostopoulos a écrit : > Grégoire, i did not understand where or why should i use your > workaround - probably you did not understand the problem i presented > in the fist place I didn't looked closely enough. ;) So the only difference with my problem is that your error comes from the "xsd" prefix not being used anywhere else than in the "bind-otherItem" : <xf:bind id="bind-otherItem" nodeset="/data:root/data:otherItem" type="xsd:integer" /> In this case, XSLTForms uses the "namespace::" axis to search through the namespaces declared, but Firefox doesn't support this axis, hence the error. But fortunately if you use this namespace somewhere else, like in the "html" element, it will work. So you ought to try this : <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsd:workaroundForFirefoxBug="https://bugzilla.mozilla.org/show_bug.cgi?id=94270" xmlns:data="http://some-uri.org/data"> If I'm not wrong (am I?), adding a bogus attribute in the "html" element won't do any damage/ Regards, Grégoire |