[xsd-users] Microsoft's Print Schema

Boris Kolpackov boris at codesynthesis.com
Tue Feb 27 10:15:06 EST 2007


Hi Dwight,

Dwight Kelly <dkelly at yahoo.com> writes:

> Hello, I tried to generate cxx-parser bindings for Microsoft's XPS
> Print Schema and received the following error message from xsd:
>
> Error Schema Representation Constraint: Namespace
> 'http://www.w3.org/2001/XMLSchema-instance' is referenced without
> <import> declaration

This is the part of the schema that causes the error:

  <xs:attributeGroup name="AG_ValueAttributes">
    <xs:attribute ref="xsi:type" use="required">
    </xs:attribute>
  </xs:attributeGroup>


It refers to the xsi:type special attribute but there is no
declarations for it. I am not sure whether it is legal or
not so I am going to as on the xmlschema-dev mailing list.
I also tested this schema with a number of schema processors.
Xerces-J accepts the schema while Xerces-C++, Jing, and MSV
all flag it as invalid.

I am not sure what exactly the author of the schema wanted to
achieve with this. Most likely they wanted the CT_Value type
(the only type that references this group) to be abstract.
This is much easier achieved with the abstract attribute:

  <xs:complexType name="CT_Value" mixed="true" abstract="true"/>

So I suggest that you comment AG_ValueAttributes out and change
the CT_Value to be as above. After these changes I could compile
the schema without any errors.


hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070227/bdfea8b1/attachment.pgp


More information about the xsd-users mailing list