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]

Namespace: what's the correct usage?





> They are local to the person
> class. The person class *is* in the namespace but the fields are not.

It seems to me that you are mixing up types and instances.

It would certainly make sense if you say your Person class as a type
resides in the namespace "http://best.practice.com" but the type of the familyName
is String so it should be in a different namespace.

In other words, the following type definition would make sense.

<complexType name="Person" xmlns:java="...">
  <sequence>
    <element name="firstName" type="java:String"/>
    <element name="lastName" type="java:String"/>
  </sequence>
</complexType>


But in the instance below, you use "person","firstName", and "lastName" as
an instance name, not as a type.

<foo:person xmlns:foo="http://best.practice.com">
  <lastName> KAWAGUCHI </lastName>
  <firstName> Kohsuke </firstName>
</foo:person>

So why you qualify "person" as an instance name while you don't qualify
"firstName" and "lastName" as instance names.


Correct me if I'm wrong. As far as I know, when the concept of this
unqualified local element is introduced (back in 1999,Nov), the rationale
is that you can find the corresponding declaration only by seeing the
tag name. So I believe XML Schema invents your way of using XML
namespaces.

SVG, SMIL, MathML ...  There are plenty of schemas that use XML
namespaces in my way. Would you show me some specs that use XML
namespaces as you suggest?



> If, and it's a *very* big if, I came across familyName in isolation then
> you're right, I wouldn't know what to do with it. I would need to walk back
> up the tree until I found a namespace qualified element that I recognized.
> What's the big deal? This happens with attributes all the time.

Technically it's not a big deal, but it's still an extra work. Because
you don't need to look up descendants if you qualify elements from the
beginning.

And sorry I couldn't get the sentence "This happens with attributes all
the time."


regards,
----------------------
K.Kawaguchi
E-Mail: kohsukekawaguchi@yahoo.com