Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

List error: "List datatype must be derived from an atomic datatype"

$
0
0

I've read that List and Union are not well supported in MSXML and I'm finding this issue perplexing beyond my ability to resolve it and would appreciate some help. I've tried every permutation of simpleTypes, ID/IDREFS, key/keyref, and anonymous types to resolve this issue to no avail. The straightforward, anonymous XSD config is shown below but it throws the subject error upon Schema load in MSXML2 in Excel 2013.

The Goal is to restrict element SOURCEList to {1,4} valid occurrences of SOURCE/NAME in the instance document. The pattern restriction, I believe, satisfies the atomic datatype requirement for SOURCE/NAME but MSXML disagrees and throws the error.

The W3C example builds a list based on an XSD enumeration which is a different scenario. What is really odd is that other (non MSXML) validators work fine but the target environment is native MSXML in Excel without 3rd party parsers. sigh...

XSD:

<xs:complexType name="SOURCEType" mixed="true"><xs:sequence><xs:element name="NAME"><xs:simpleType><xs:restriction base="xs:ID"><xs:pattern value="[A-Z]([A-Z0-9;&#32;&#45;]){1,8}"/></xs:restriction></xs:simpleType></xs:element><!-- other elements --></xs:sequence></xs:complexType>  <xs:element name="SOURCELIST"><xs:simpleType><xs:restriction><xs:simpleType><xs:list><xs:simpleType><xs:restriction base="xs:IDREFS"/></xs:simpleType></xs:list></xs:simpleType><xs:minLength value="1"/><xs:maxLength value="4"/></xs:restriction></xs:simpleType></xs:element>

XML:

<!-- data origin elements --><ela:SOURCE><ela:NAME>GEN-1</ela:NAME></ela:SOURCE><ela:SOURCE><ela:NAME>GEN-2</ela:NAME></ela:SOURCE><ela:SOURCE><ela:NAME>GEN-3</ela:NAME></ela:SOURCE><ela:SOURCE><ela:NAME>GEN-4</ela:NAME></ela:SOURCE><ela:SOURCE><ela:NAME>EP1A</ela:NAME></ela:SOURCE><ela:SOURCE><ela:NAME>EP1B</ela:NAME></ela:SOURCE><ela:SOURCE><ela:NAME>EP2A</ela:NAME></ela:SOURCE><ela:SOURCE><ela:NAME>EP2B</ela:NAME></ela:SOURCE><!-- data receiving elements --><ela:MODE><ela:SOURCELIST>GEN-1 GEN-2 GEN-3 GEN-4</ela:SOURCELIST></ela:MODE><ela:MODE><ela:SOURCELIST>EP1A EP1B EP2A EP2B</ela:SOURCELIST></ela:MODE><ela:MODE><ela:SOURCELIST>EP1A</ela:SOURCELIST></ela:MODE>


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>