Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XMLSchema: xmlns:* and xsi:SchemaLocation usage

305520Jul 16 2002
A96620-01 page 5-5 states that

"An XML instance document must specify both the namespace of
the root element (same as the XML schemas target namespace) and
the location (URL) of the XML schema that defines this root
element. The location is specified with attribute
xsi:schemaLocation. When the XML schema has no target
namespace, use attribute xsi:noNamespaceSchemaLocation to
specify the XML schema URL."

I agree with the second statement, but I think the first one, although partly (!) true for 9iR2, is in conflict with the general notion of namespaces. In fact XDB is using the xsi:schemaLocation as if it were a namespace (by using it as the search key in the database). The real namespace as it appears in the document is only used locally to retrieve the xsi:location (try it by replacing it both in the xmlns and the xsi:schemaLocation attributes. No matter what you enter, it is accepted).

In my opinion, this is a bug. If present, any xmlns or xmlns:* attribute value should be used directly to retrieve the schema. Even if a schemaLocation is present, it should be ignored, as it only points to a (possibly different) local or Web location where the schema could be found. Only if there is no namespace, the xsi:noNamespaceSchemaLocation value should be used to retrieve the schema.

Age Jan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2002
Added on Jul 16 2002
4 comments
1,002 views