- From: Biron,Paul V <Paul.V.Biron@kp.org>
- Date: Fri, 29 Mar 2002 12:03:21 -0800
- To: "'Gaurav Kathotia'" <gauravka@in.ibm.com>, W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
> -----Original Message-----
> From: Gaurav Kathotia [SMTP:gauravka@in.ibm.com]
> Sent: Friday, March 29, 2002 6:01 AM
> To: W3C XML Schema Comments list
> Subject: [www-xml-schema-comments] <none>
>
> hello
> While Checking an .XSD file with IBM SchemaQualityChecker, i get
> numerous errors , all of which are of the same type, i:e
>
> " The reference ObjRef( /* which is a ComplexType element in my .XSD
> file
> */)
> uses the empty string as its prefix . But there is no namespace
> declaration
> which associates the empty string
> with a namespace .
> To fix the problem, you may add the attribute "xmlns" in the root
> element <<schema>>"
>
> Now my <<schema>> looks like this.
>
> <xsd:schema
> xmlns:xsd="http://www.w3.org/2002/XMLSchema"
> targetNamespace="http://wat-eu-2.watson.ibm.com/~mspreitz/wsstk"
> xmlns:tns="http://wat-eu-2.watson.ibm.com/~mspreitz/wsstk"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified"
> >
>
> And a possible source of error reference is contained in the below lines:
>
> <xsd:complexType name="ObjRef">
> <xsd:attribute name="ref" type="xsd:anyURI" use="required" />
> <xsd:attribute name="role" type="xsd:NMTOKEN" />
> </xsd:complexType>
>
> <xsd:complexType name="NamedObjRef">
> <xsd:complexContent>
> <xsd:extension base="ObjRef">
> <xsd:attribute name="name" type="xsd:NMTOKEN" />
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
>
> Could Anyone suggest the remedy for this ?
>
Given the namespace declarations above, NamedObjRef declaration should look
like:
<xsd:complexType name="NamedObjRef">
<xsd:complexContent>
<xsd:extension base="tns:ObjRef">
<xsd:attribute name="name" type="xsd:NMTOKEN" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
i.e., you need to prefix ObjRef when referring to it (alternatively, you
could declare your target namespace as the default namespace and then you
wouldn't need to prefix references to types/elements/attributes in your
namespace).
pvb
Received on Friday, 29 March 2002 15:17:55 UTC