This is my xml schema where I am trying to refer to global element, but getting error.
Line number 11 causing the below error.
src-resolve.4.2: Error resolving component 'schema'. It was detected that 'schema' is in namespace 'http://www.w3.org/2001/XMLSchema',
but components from this namespace are not referenceable from schema document
If this is the incorrect namespace, perhaps the prefix of 'schema' needs to be changed.
If this is the correct namespace, then an appropriate 'import' tag should be added to
how to resolve this?
Joined: Jan 13, 2010
Joined: Jan 18, 2011
Since w3c schema is in a different namespace than the present target namespace of the schema, you've to import it. The import element is a top level element, hence, you place the following accordingly.
I deliberately omit the schemaLocation in the above as it is only a suggestive data and you could be overridden at the application level. If you let the validation engine do the import implicitly with the data so supplied, you can put it there as well, like this.
That is the schema for schema supplied by the consortium. (It includes some dtd and sometime could cause trouble to some engine's default loading.) If you've anything better or a more restructive subset of it, you can actually supply any other location as long as the required schema for schema is properly pointed to.