[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Namespace: what's the correct usage?
- From: Jeff Rafter <jeffrafter@earthlink.net>
- To: Jonathan Borden <jborden@mediaone.net>
- Date: Mon, 21 May 2001 16:41:56 -0700
> 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
while
> 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.
Reagrds,
Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting