Sign In/My Account | View Cart  
advertisement

Article:
 Schema Scuffles and Namespace Pains
Subject: namespaces
Date: 2001-08-07 23:13:53
From: Marc Portier

I just read the article at xml.com:
http://www.xml.com/pub/a/2001/05/30/deviant.html
(so this comes totally out of the blue...)


I found the reasoning behind:


public class Person
{
String lastName;
String firstName;
}


as being a logic reason for having:


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


not very satisfying...


in the java space (see example) person functions as a type, while the familyName and lastName ar members (best practice would be to call them m_whatever :-))


at best the so called 'logical/natural' serialization would lead to:
<person>
<string name="familyName"> KAWAGUCHI </string>
<string name="lastName"> Kohsuke </string>
</foo:person>


which I would never state as being nice xml...
so even before we delve into discussions on the namespaces-mess we should understand that it's no good to try and argument in this discussion by referring to other namespacing techniques in other languages or address spaces with totally different purposes (java packages, dns naming, ...)
Elements, subelements and attributes do not [ever] map 'naturally' onto classes, instances, types, members etc. etc. (ask the JAXB guys about this: they needed to invent some additional mapping language)


XML tries to service both the data and document audience, so it's fairly normal


Having said that, it would be nice that someone _could_ finally explain what the default namespace actually is :-)


as far as diambiguity is concerned, I'm definately +1 for prefixing all elements... only it kind of blows up the whole idea of having namespaces in the first place :-) and it's surely not what the vim and notepad xml authors are waiting for...


-marc=
mpo@outerthought.org


No Previous Message Previous Message   Next Message Next Message


Sponsored By: