[xsd-users] Issue using proxy for Open Packaging Conventions core-properties schema

Boris Kolpackov boris at codesynthesis.com
Wed Jun 26 08:29:37 EDT 2013


Hi Rob,

Rob Ursem <Rob.Ursem at cmgl.ca> writes:

>   <xs:element name="any" type="SimpleLiteral" abstract="true"/>
>   
>   <xs:element name="title" substitutionGroup="any"/>
>   <xs:element name="creator" substitutionGroup="any"/>
>   <xs:element name="description" substitutionGroup="any"/>
>   <xs:element name="identifier" substitutionGroup="any"/>
>
> I thought that since there is a definition of the "any" element (of type
> SimpleLiteral) that any element in the "any" substitution group would be of
> the SimpleLiteral type.  This would make my customization work like a
> charm. Instead it seems that XSD is interpreting substitutionGroup="any" as
> the "xs:any" type.

Normally, when you don't specify a type for an element, XML Schema
spec defaults to anyType. But apparently if an element is a member of a
substitution group, then instead it "inherits" the type of the group's
root. XSD doesn't handle this special case, which is a bug.

I am going to go ahead and fix it for the next release. Also, if you
would like, I can build you a pre-release binary with the fix. Just
let me know which platform you are using.


> Thus far I have not been able to customize xml_schema::type.

It is possible to do that. This earlier post has more information:

http://www.codesynthesis.com/pipermail/xsd-users/2009-October/002492.html


> My short term work around (I've spent several days on what should be trivial)
> is to replace substitutionGroup="any" by type="SimplLiteral" in dc.xsd.
> This makes all the code working and now my tests pass. But it still doesn't
> feel right.

No, there is actually nothing wrong with this since your schema is
semantically equivalent to the original. You just explicitly specified
the type which should have been used implicitly.

Boris



More information about the xsd-users mailing list