W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2003

Re: xsd

From: Jeni Tennison <jeni@jenitennison.com>
Date: Thu, 10 Jul 2003 09:35:27 +0100
Message-ID: <107252785536.20030710093527@jenitennison.com>
To: Kevin Terry <tkr_13@yahoo.com>
CC: xmlschema-dev@w3.org

Hi Kevin,

> I tried to validate the an XSD, using on on-line xml validator
> (http://apps.gotdotnet.com/xmltools/xsdvalidator/Default.aspx) but
> returned following error:
> Validation error:
> Cannot resolve schemaLocation attribute. An error
> occurred at , (3, 4).

This error is telling you that the validator couldn't use a
schemaLocation attribute to identify a schema that it should use. This
could be a problem with the xsi:schemaLocation attribute in your
instance document, but I think it's probably talking about the fact
that where you import a schema for the
'http://www.w3.org/2000/09/xmldsig#' namespace, you don't supply a
schemaLocation attribute so it doesn't know where to find the schema
for that namespace.

> The 'http://www.w3.org/2000/09/xmldsig#:Signature' element is not
> declared. An error occurred at , (69, 10).

This arises because the validator couldn't find a schema for the
'http://www.w3.org/2000/09/xmldsig#' namespace. Without a schema,
there aren't any element declarations, so it can't find the element
declaration for the <Signature> element in that namespace that you
refer to in your schema.

The solutions are to either:

1. put a schemaLocation attribute on the <xs:import> element to point
the validator to the location of a schema for that namespace: there's
one at http://www.w3.org/TR/xmlndsig-core/xmldsig-core-schema.xsd that
you could use:

<xs:import namespace="http://www.w3.org/2000/09/xmldsig#"

2. use a wildcard that allows any element in the
'http://www.w3.org/2000/09/xmldsig#' namespace rather than a pointer
to the particular <Signature> element:

  <xs:any namespace="http://www.w3.org/2000/09/xmldsig#" />



Jeni Tennison
Received on Thursday, 10 July 2003 04:35:32 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:02 UTC