Is it me or is it InfoPath?

I have been exploring the potential of the proposed new European Norm on Metadata for Learning Opportunities (MLO) for modelling proposed changes to curriculum.

The MLO work uses Dublin Core Abstract Model notions of refining properties to sub-class them.

I have been considering the use of Microsoft’s InfoPath for creating forms based on XML schema representations of MLO, which colleagues could use to enter proposed changes to curriculum: for instance, a change to assessment weighting for a particular course unit.

However, I seem to be coming un-stuck when I try to sub-class a property that has been defined using XML wildcards.

Here’s a simplified example of my problem. I have a Parent type that is defined as mixed content, with the xs:any wildcard specifying any element 0 or more times. I have a Child type that refines the parent to be non-mixed content with a single identifier element. InfoPath is able to generate a form for elements of type Child.

<?xml version=”1.0″ encoding=”utf-8″?>
<xs:schema xmlns=”http://tempuri.org/XMLSchema.xsd” xmlns:mstns=”http://tempuri.org/XMLSchema.xsd” xmlns:xs=”http://www.w3.org/2001/XMLSchema” targetNamespace=”http://tempuri.org/XMLSchema.xsd” elementFormDefault=”qualified” >
<xs:complexType name=”Parent” >
<xs:complexContent mixed=”true” >
<xs:restriction base=”xs:anyType” >
<xs:sequence >
<xs:any processContents=”lax” minOccurs=”0″ maxOccurs=”unbounded” />
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:complexType name=”Child”>
<xs:complexContent mixed=”false”>
<xs:restriction base=”Parent”>
<xs:sequence>
<xs:element name=”identifier” type=”xs:string”/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:element name=”root” type=”Child”/>

</xs:schema>

However, if I specify that the Child node has two elements (for instance, identifier and title), the schema validates but InfoPath cannot generate a form from the schema and returns the error:

Invalid particle derivation by restriction.
Base type : ‘{http://tempuri.org/XMLSchema.xsd}Parent’
Derived type : ‘{http://tempuri.org/XMLSchema.xsd}Child’

It appears that InfoPath regards the Child type as an invalid restriction of the Parent wildcard.

<xs:complexType name=”Child”>
<xs:complexContent mixed=”false”>
<xs:restriction base=”Parent”>
<xs:sequence>
<xs:element name=”identifier” type=”xs:string”/>
<xs:element name=”title” type=”xs:string”/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

Am I missing something here, or is InfoPath correct in saying that a Child with two specific nodes is not a valid restriction of a Parent with 0 or more nodes?

Leave a Reply

Your email address will not be published. Required fields are marked *