[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Namespace: what's the correct usage?
I'm glad to know that we are not the only ones who have opinions about this. > Bottom line. Why should everyone have to use namespaces in a particular way? > I just don't get it... I'm just trying to say that everyone should avoid using unqualified local elements. It doesn't mean we have to use it in only one way. > Actually, I provided that example because I thought you may be happier with > it. In reality I use the class name for the top-level element. Why? Because > typically I'm serializing an instance of a class and I probably don't know OK, then take a look at another example of yours. I think you agree to unqualify title, genre, and familyName. <p:book xmlns:p='urn:x1'> <title>The Hobbit</title> <genre>Fantasy</genre> <p:author> <title>Dr</title> <familyName>Tolkien</familyName> </p:author> </p:book> But I guess you would object to unqualify <author> element. But why? "author" is a field of an instance of the book type, just like title and genre do. If you don't object to unqualify <author> element. Then the root element is the only element in your instance that is qualified. Then what is the reason to qualify <book>? Why not unqualify all? Technically, your statement that the "unqualified-local" doctrine is suitable for "data serialized as XML" is wrong. > No, this was not invented by XML Schema, unqualified elements are allowed by > the namespaces rec just as unqualified attributes are allowed by the > namespaces rec. Of course it is "allowed". But it's just that nobody imagined that such an interpretation is possible. > Again, I reiterate, it's not that the qualify-all approach is wrong, it's > that I don't see it as the only approach. I know. I can't state without some hesitation that it is THE only one approach. But I believe the unqualified-local doctrine is wrong. > And it's used by SOAP which is a fairly popular technology, in fact I'd say That's why I really want to know if there is any other spec that uses the same doctrine. So far, nothing is mentioned by anyone. I checked XML-RPC but it doesn't use XML namespaces at all. > > If so, the innocent authors should be warned not to be trapped to such a > > small dialect just because he/she wants to use XML Schema. And in fact > > there are many practical reasons (vulnerability to the change of the > > schema structure, more typing, etc.) that he/she should avoid it. > > [MJG] > What authors? There are no (few?) authors for SOAP messages, unless you I meant "the innocent schema authors" who are just beginning to learn XML Schema. > And why is this a 'small dialect'? Because virtually every known schema (except SOAP) uses the "qualify-all" doctrine. > Why does using unqualified local elements lead to 'vulnerability to the > change in schema structure' and 'more typing'? "It is vulnerable to the change in a schema file" because instance documents have to be changed if you change one of your local declaration to a global one so that it can be shared. "It needs more typing" because you can't use the default namespace declaration. I think these are objective facts. > > An explanation along with this line may be more adequate. > Err, I didn't understand this last sentence? Sorry. I meant that an explanation along with this line is probably more adequate for my "XML Schema: DOs and DON'Ts", as the reason of why one should avoid unqualified local elements. regards, ---------------------- K.Kawaguchi E-Mail: kohsukekawaguchi@y...
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|