[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Enlightenment via avoiding the T-word
Rick Jelliffe wrote: > Yes, if you want to reuse local names, you need as many namespaces > as you have re-uses. That's the way it should be: no local names, no > local types. Rick, I think there is a slippery slope between what you're arguing and an even more restrictive use of markup than what DTDs allow. DTDs let me put the same element name in different contexts. If you want a purer grasp on "meaning" given only the ulabel, a surer bet would be to never use the same element name in more than one place. Then you can be sure that the content models will not diverge based on their context, now or in the future. Using DTDs doesn't safeguard you from using "bad markup" by your definition, because you can always do a "choice" between different content models in order to merge them into your DTD. Are you claiming that the choice between the left-hand-side of a given "|" and the right-hand-side should *never* be informed by the element's context in the document? I am not willing to make that claim, and I certainly wouldn't claim a priori that such is "bad markup". I don't have schemas for my primary de facto schemas (my company's XML-based query language, for example). DTDs are insufficient for other reasons (namespaces), but they would also be less-than-desirable because I would have cases where the choice between which side of "|" to use is informed by the context. I would rather be able to declare the content models for these separately, that's all. I use namespaces in two basic ways: 1) to signify/declare/maintain ownership (think company vs. company), and 2) as a convenient classification mechanism to scope between different parts of a larger-scale application (think embedded processing hooks). A third way to use namespaces would be to alter the ulabel every time a given local name (a name chosen carefully by design) has a different content model (or even context; after all, different contexts imply the possibility of different content models in the future at least). I do *not* use this third way and am not willing to accept that anything but is bad practice. Sorry. Evan Lenz XYZFind Corp. P.S. I've gotten along fine without a PSVI so far. The notion that a PSVI is all you need is a scary one indeed and tells me that I have a lot more to look forward to in my reading of the XML Schemas spec. Coming from a merely well-formed world, I presume that I will use schemas for validation and documentation, but that it will never substitute for writing code. > -----Original Message----- > From: Rick Jelliffe [mailto:ricko@a...] > Sent: Tuesday, August 28, 2001 2:27 AM > To: xml-dev@l... > Subject: Re: Enlightenment via avoiding the T-word > > > From: "Nicolas LEHUEN" <nicolas.lehuen@u...> > > > Well I wouldn't be surprised that by adhering to the > "all-global" policy, we > > would soon find our namespaces too small... Let's consider this > (somewhat > > corny) "purchase" sample with local elements : > > > > <purchase xmlns="http://foobar/purchase"> > > <customer> > > <name>Nicolas</name> > > <address>Paris, France</address> > > </customer> > > <delivery> > > <mode>UPS</mode> > > <address>Somewhere else</address> > > </delivery> > > <lines> > > <line> > > <!-- duh, will this wake up Echelon :) ? --> > > <product> > > <name>ACME Explosives</name> > > <price currency="dollar">2000</price> > > </product> > > <quantity>200</quantity> > > </line> > > </lines> > > </purchase> > > Sorry, where are the local types in this? You need to provide a schema > or some clearer indication, otherwise I cannot follow the example. But it > doesn't seem very convincing, from what I can follow: to say that > having "mode" and "mode" with different meanings is preferable to > having "mode" and "deliveryMode" is baffling. [Of course context will > be useful for figuring out the meaning of an element when you first > come to it; but if the meaning is different depending on each context > (without warning) there is no way to synthesize the meaning from > the multiple contexts.] > > On the concrete point of not wanting to use different namespaces > because it > complicates things, namespaces are the W3C technology for preventing > name clashes and allowing modularization. They are the appropriate thing > to use, if it is impossible to figure out alternative names. If > you don't want > to use multiple namespaces, why even use one? > > If your tools don't handle schemas with multiple namespaces well, > get better tools, > don't foist PSVI on the rest of us :-) > > > Problem is, the only way to have both global > > element names only AND achieve modularity and extensibility is to > > extensively use namespaces, > > Yes, if you want to reuse local names, you need as many namespaces > as you have re-uses. That's the way it should be: no local names, no > local types. If different columns in tables in DBMS have the same name, > it is a mapping issue not something that should be needed by an XML > schema language. And if it makes auto-generated Java more complicated, > boo hoo. > > Cheers > Rick Jelliffe > > > ----------------------------------------------------------------- > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an > initiative of OASIS <http://www.oasis-open.org> > > The list archives are at http://lists.xml.org/archives/xml-dev/ > > To subscribe or unsubscribe from this elist use the subscription > manager: <http://lists.xml.org/ob/adm.pl> >
|
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
|