Re: [Xsltforms-support] trouble with XML schema that specializes its own simpleType
Brought to you by:
alain-couthures
From: Adam M. <Ada...@gm...> - 2013-07-03 08:59:38
|
Hi Alain, In the course of preparing a simplified testcase I narrowed down the problem (as often happens). It does seem to have to do with prefixes. Here are my two files: xform.xml: http://pastebin.com/HEf7kAYz (not bare minimum but not a big form either) acms.xsd: http://pastebin.com/yaXc8zaJ (fairly minimized) In the schema, see the two different definitions of the "string20" type, one of which is commented out. When "string20" specializes "nonEmptyString" defined in the same schema, XSLTForms will only process that correctly if no namespace is specified for the name of the base type. Unfortunately, that change makes the schema itself flunk validation. I'm guessing (but have not tested) that there would be no problem with specializing a simple string type defined in *another* schema. I also haven't tested with specializing other types besides strings, but I assume it would be the same problem. Thanks for your help. On Mon, Jul 1, 2013 at 11:04 PM, Alain Couthures <ala...@ag...> wrote: > Hello Adam, > > This should work because XSLTForms supports xs:simpleType and successive > restrictions. This sounds more like a prefix issue. > > Could you please send me a minimal testcase? > > Thanks! > > -Alain > > Le 01/07/2013 23:51, Adam McKee a écrit : >> >> Hi Alain & everyone, >> >> I've found XSLTForms 576 does not appreciate an XML Schema that >> specializes its own SimpleType. >> >> For example, if my schema defines this simple type: >> >> <xs:simpleType name="nonEmptyString"> >> <xs:restriction base="xs:string"> >> <xs:minLength value="1"/> >> <xs:pattern value="\S+(.*\S+)?"/> >> </xs:restriction> >> </xs:simpleType> >> >> ... and then specializes it to create another simple type: >> >> <xs:simpleType name="string100"> >> <xs:restriction base="myns:nonEmptyString"> >> <xs:maxLength value="100"/> >> </xs:restriction> >> </xs:simpleType> >> >> ... then XSLTForms will not accept the schema. It complains: >> >> "Schema for namespace undefined not defined for type nonEmptyString" >> >> The schema is valid. If I load it into <oXygen/> editor for example, >> it correctly understands the "string100" type. >> >> I can work around this by making the "string100" type a specialization >> of "xs:string", and repeating in the "string100" type all the >> constraints that are specified for the "nonEmptyString" type. >> >> What do you make of this? >> >> Thanks! >> >> -Adam >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> > |