Hi Paul,
Substitution groups and schema validation are fairly esoteric.
The dcterms:references may be substituted anywhere dc:relation is allowed; this is what being in a substitutionGroup means. Thus having a dc:relation immediately followed by a dcterms:references creates an ambiguity such that the validator cannot determine whether a given sequence is valid or not without looking ahead, and validators are not allowed to look ahead; they must be able to determine whether a given element in a sequence is valid or not based on just the element itself and what has come before it in the sequence. Here is an error message from a different parser which might be more helpful although still pretty obtuse:
Description: Multiple definition of element 'http://purl.org/dc/terms/:references' causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence.
This article might also be useful: http://msdn.microsoft.com/en-us/library/ms187822.aspx
One thing you could do to eliminate the ambiguity is to separate the relation and references by some other mandatory element, such as this:
<xs:element
ref="dc:relation"
minOccurs="0"
maxOccurs="unbounded"
/>
<xs:element name="junk" minOccurs="1"/>
<xs:element
ref="dcterms:references"
minOccurs="0"
maxOccurs="unbounded"
/>
One thing to note is that since you are importing the dcterms schema with the substitution groups, any of the dc:relation sub-elements may be substituted for the dc:relation element and the document would still be schema valid. I suspect that your intention was to just allow the dc:relation element and not its sub-elements. I'm not sure there is any way to restrict this and still import the various DC schema.
Hope this helps,
Tom
> -----Original Message-----
> From: General DCMI discussion list [mailto:[log in to unmask]]
> On Behalf Of Paul Walk
> Sent: Wednesday, April 10, 2013 10:30 AM
> To: [log in to unmask]
> Subject: dcterms, substitutionGroup and unique particle attribution
>
> I suspect I may embarrass myself with this question, but here goes anyway:
>
> I have defined a schema which includes the following elements in an
> <xs:sequence>:
>
> <xs:element
> ref="dc:relation"
> minOccurs="0"
> maxOccurs="unbounded"
> />
>
> <xs:element
> ref="dcterms:references"
> minOccurs="0"
> maxOccurs="unbounded"
> />
>
> I'm also declaring the following imports:
>
> <xs:import namespace="http://purl.org/dc/elements/1.1/"
> schemaLocation="dc.xsd"/> <xs:import
> namespace="http://purl.org/dc/terms/" schemaLocation="dcterms.xsd"/>
>
> The result of this is that the xsd throws a "unique particle attribution" error
> [1]
>
> I'm pretty confident that the reason for this has to do with the fact that
> dcterms:references has a 'substitutionGroup' attribute which points to
> dc:relation - it's declared in dcterms.xsd thus:
>
> <xs:element name="references" substitutionGroup="dc:relation"
> type="dc:SimpleLiteral"/>
>
> I can hack (and indeed have hacked, for now at least) a 'solution' by simply
> editing dcterms.xsd to remove the substitutionGroup attribute for
> dcterms:references, but I would like to understand how one might normally
> use a mixture of dcterms and dc elements in a sequence like this without
> hitting this issue.
>
> Thanks!
>
> Paul
>
> [1] http://en.wikipedia.org/wiki/Unique_Particle_Attribution
> -------------------------------------------
> Paul Walk
> Blog: http://blog.paulwalk.net
> Skype: paulwalk
> Twitter: paulwalk
> Mobile: 07812 510001
> -------------------------------------------
|