OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Namespace: what's the correct usage?

> That has been pointed out and I now see. What initially surprised me what
> that a 'top level' element decl would _default_ to the targetNamespace
> an element declared inside a complexType _defaults_ to no namespace.

It does seem odd.  The only logic that I have come up with is that XML
Schemas are intended to be used in namespace valid situations whereas the no
namespace sample you cite clearly does nothing wrt to namespaces.  Therefore
(taking the position that the targetNamespace is expected or allowed) at
least the the top level element must refer to the namespace which has been
defined and nothing else needs to as it can easily be inferred through
context.  At that point the validator (or whatever) can begin processing
that element and contents against the defined schema for that namespace
(without the need to qualify any further contents).  When there is no
targetNamespace it is all a moot point.  More and more though I am seeing
the problems that arise with unqualified elements from a schema/instance
creation POV.

Jeff Rafter
Defined Systems
XML Development and Developer Web Hosting