Futher to my comment about not being ready for standardisation, see below
message forwarded from Tom Habing at UIUC.
(Summary: MSXML says our schema is fubar, and another validator does the
wrong thing)
Matthew, any comments?
Rob
---------- Forwarded message ----------
Date: Mon, 12 Jul 2004 11:18:42 -0500
From: Thomas G. Habing <[log in to unmask]>
To: Robert Sanderson <[log in to unmask]>
Subject: Re: OAI-PMH registry and ZeeRex
Hi Rob,
Sorry its taken me so long to get around to this. However, in looking at this
fix I seem to have discovered a potential problem with SRW XML Schema:
http://www.loc.gov/z3950/agency/zing/srw/srw-types.xsd
Being a good XMLer :-) I always try to validate my files against the relevant
schemas. My tools of choice are usually the Microsoft XML toolkit (MSXML 4.0)
and the XSV validator from http://www.ltg.ed.ac.uk/~ht/xsv-status.html.
The MS toolkit complains that the XML Schema is not valid, and XSV does not
give the expected result.
The XML Schema fragments relevant to your explainResponse are these:
<xsd:complexType name="responseType">
<xsd:all>
<xsd:element ref="version"/>
<xsd:element ref="diagnostics" minOccurs="0"/>
<xsd:element ref="extraResponseData" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="explainResponseType">
<xsd:complexContent>
<xsd:extension base="responseType">
<xsd:all>
<xsd:element ref="record"/>
<xsd:element ref="echoedExplainRequest" minOccurs="0"/>
</xsd:all>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Assuming that these are valid (see the following), to me this indicates that an
<explainResponse> must contain at least a <version> and a <record>, along with
some optional stuff including <diagnostics>. Therefore, I was surprised when
the XSV validator didn't complain about your original suggested correction
above, because it didn't contain either a version or record element. Then I
tried validating it using the MS XML toolkit which complained that the XML
Schema itself was not valid. When I looked up the error message returned by MS
XML, I got this web page
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q316635 which
essentially explains that using <xsd:all> inside of an <xsd:extension> is not
legal.
Presumably, the developers of this schema have done some testing with various
validators, so I would be willing to accept that Microsoft's interpretation of
the schema spec is wrong, but it is also curious that the XSV validator, while
it doesn't complain of an error is unable to correctly validate against the
schema.
My suggestions would be to avoid using extensions of all groups, such that the
explain response becomes:
<xsd:complexType name="explainResponseType">
<xsd:all>
<xsd:element ref="version"/>
<xsd:element ref="diagnostics" minOccurs="0"/>
<xsd:element ref="extraResponseData" minOccurs="0"/>
<xsd:element ref="record" minOccurs="0"/>
<xsd:element ref="echoedExplainRequest" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
Assuming that the record really should be an optional element. The other "all
extensions" could be modified similarly.
In any case, I've made your suggested correction, ignoring the fact that I
can't get it to validate with the current schema.
Kind regards,
Tom
|