[OAI-implementers] OAI validation problem
Young,Jeff
jyoung@oclc.org
Thu, 22 May 2003 09:15:33 -0400
I've always made a point of being willfully ignorant about XML Schemas, but
it's time I gave it a try. The trick seems to be to define an abstract type
to use in place of <any namespace="##other".../> This abstract type would
then require the xsi:schemaLocation.
So, in place of this:
<complexType name="metadataType">
<sequence>
<any namespace="##other" processContents="strict"/>
</sequence>
</complexType>
do something like:
<xsd:complexType name="abstractContent" abstract="true">
<xsd:sequence min-Occurs="1" maxOccurs="1">
<any namespace="##other" processContents="strict" />
</xsd:sequence>
</xsd:complexType>
<complexType name="metadataType">
<xsd:complexContent>
<xsd:extension base="abstractContent">
<xsd:attribute name="xsi:schemaLocation"
type="xsd:string" use="required" />
</xsd:extension>
</xsd:complexContent>
</complexType>
If that isn't right, then maybe it's something like this:
<xsd:element name="Content" abstract="true" type="abstractContent" />
<xsd:complexType name="abstractContent">
<sequence>
<any namespace="##other" processContents="strict" />
</sequence>
<xsd:attribute name="xsi:schemaLocation" type="xsd:string"
use="required" />
</xsd:complexType>
<complexType name="metadataType">
<xsd:sequence>
<xsd:element ref="Content" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</complexType>
No promises, though..
Jeff
> -----Original Message-----
> From: Hussein Suleman [mailto:hussein@cs.uct.ac.za]
> Sent: Wednesday, May 21, 2003 5:55 PM
> To: OAI-implementers (E-mail)
> Subject: Re: [OAI-implementers] OAI validation problem
>
>
> hi Jeff
>
> some random thoughts ...
> - could the schema be modified to reflect a required
> xsi:schemaLocation
> attribute? that might be the easiest fix.
> - alternatively, does DOM3 propagate schema information like DOM2
> propagates namespaces? if so, then there might be a method to
> directly
> retrieve the schema for a given node/element.
>
> ttfn,
> ----hussein
>
>
> Young,Jeff wrote:
> > I think I found a hole in the OAI validation mechanisms. I
> believe the
> > contents of the <metadata> element should be required to have an
> > xsi:schemaLocation attribute to make it easier to identify
> the schema for
> > the data. Without it, harvesters are forced to use the
> > /oai2:OAI-PMH/oai2:request/@metadataPrefix value and look
> it up in the
> > ListMetadataFormats response, which is more trouble than having it
> > immediately available as an attribute.
> >
> > The examples in the OAI protocol document do show it as an
> attribute, but
> > apparently the Repository Explorer and the Registration
> validation available
> > on the OAI site don't check for it.
> >
> > Jeff
> >
> > ---
> > Jeffrey A. Young
> > Consulting Software Engineer
> > Office of Research, Mail Code 710
> > OCLC Online Computer Library Center, Inc.
> > 6565 Frantz Road
> > Dublin, OH 43017-3395
> > www.oclc.org
> >
> > Voice: 614-764-4342
> > Voice: 800-848-5878, ext. 4342
> > Fax: 614-718-7477
> > Email: jyoung@oclc.org
> >
> >
> > _______________________________________________
> > OAI-implementers mailing list
> > List information, archives, preferences and to unsubscribe:
> > http://oaisrv.nsdl.cornell.edu/mailman/listinfo/oai-implementers
> >
>
>
> --
> =====================================================================
> hussein suleman ~ hussein@cs.uct.ac.za ~ http://www.husseinsspace.com
> =====================================================================
>
>
> _______________________________________________
> OAI-implementers mailing list
> List information, archives, preferences and to unsubscribe:
> http://oaisrv.nsdl.cornell.edu/mailman/listinfo/oai-implementers
>