[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Namespace: what's the correct usage?
- From: Jonathan Borden <jborden@mediaone.net>
- To: Martin Gudgin <marting@develop.com>,Kohsuke KAWAGUCHI <kohsukekawaguchi@yahoo.com>, xml-dev@lists.xml.org
- Date: Sat, 19 May 2001 17:52:04 -0400
Martin Gudgin wrote:
> > > <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'
> > > xmlns:this='urn:example.org.people'
> > > targetNamespace='urn:example.org.people' >
> > >
> > > <xs:complexType name='person' >
> > > <xs:sequence>
> > > <xs:element name='given' type='xs:string' />
> > > <xs:element name='family' type='xs:string' />
> > > </xs:sequence>
> > > </xs:complexType>
> > >
> > > <xs:element name='person' type='this:person' />
> > >
> > > </xs:schema>
> >
> > 2) it also looks like all these elements are in the same namespace (as I
> > suggested).
>
> [MJG]
> Errr, no. The way the schema is written the person element is in the
> namespace 'urn:example.org.people' and the given and family elements are
> unqualified. Instance would be;
>
> <p:person xmlns:p='urn:example.org.people' >
> <given>Martin</given>
> <family>Gudgin</family>
> </p:person>
>
In reading the XML Schema -1 spec describing the targetNamespace of an
element decl:
"If form is present and its ·actual value· is qualified, or if form is
absent and the ·actual value· of elementFormDefault on the <schema> ancestor
is qualified, then the ·actual value· of the targetNamespace [attribute] of
the parent <schema> element information item, or ·absent· if there is none,
otherwise ·absent·."
I cannot see why the "person" element decl is any different than the "given"
element decl, as they both have the same ancestor <schema> and no form nor
elementFormDefault attribute values.
If I am not reading this correctly then it is incomprehensible to me.
-Jonathan