Re: [Xsltforms-support] bind type and NCName in xsltforms r295
Brought to you by:
alain-couthures
From: COUTHURES A. <ala...@ag...> - 2010-01-02 21:53:26
|
Leigh, Thank you for those two improvements. I have tested them successfully with latest Test 5.2.1.a of W3C XForms Test Suite after removing "xforms:" within @type. -Alain > In XSLTForms if I use > <xf:bind nodeset="foo" type="anyURI" /> > I get a popup error that says "Schema undefined not defined." > > I believe there are two possible things to fix here: > > 1. The error message could be better. > 2. XForms says that NCNames are considered to be in the XForms namespace, which means for anyURI that it's the xforms:anyURI type (union of empty string and xsd:anyURI). > > Here are some possible fixes. > Other fixes may be better, for example changing Schena.prototype.getType, but this is what I found. > Possible fix for #1: > > Schema.getTypeNS = function(ns, name) { > var schema = Schema.all[ns]; > > if (!schema) { > alert("Schema for namespace " + ns + " not defined; type " + type); > throw "Error"; > } > > var type = schema.types[name]; > > if (!type) { > alert("Type " + name + " not defined in namespace " + namespace); > throw "Error"; > } > > return type; > }; > > > Possible fix for #2: > Schema.getType = function(name) { > var res = name.split(":"); > if (typeof(res[1]) == "undefined") { > return Schema.getTypeNS(Schema.prefixes["xforms"], res[0]); > } else { > return Schema.getTypeNS(Schema.prefixes[res[0]], res[1]); > } > }; > > This supposes that the xforms:anyURI type is properly implemented, which is a separate issue I didn't explore. > > > Leigh. > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > |