- From: Al Gilman <asgilman@iamdigex.net>
- Date: Fri, 09 Jun 2000 10:11:05 -0500
- To: xml-uri@w3.org
At 08:49 AM 2000-06-09 -0400, keshlam@us.ibm.com wrote: >>If I go (as I have) >> >>xmlns:x="x" >>xmlns:y="y" >>xmlns:z="z" > >Question: What do you really gain by doing so? You do save a few bytes and >keystrokes in a string that typically appears once and only once in the >file, but I'm afraid that I don't consider that an extremely compelling >argument. > >And how often are you really going to want to do this? Generally, >namespaces are more than just disambiguation; they're strings that >application code matches on, and that application layer is going to drive >what names are meaningful. For example, if you're writing an XSLT >stylesheet, you have to use XSLT's namespace. Even if all you're doing is >validating against a schema, I think you're going to find that most schemas >_do_ want their names to be global. > >Also, if you don't care about the NS per se and just want to prefix your >names -- what's the advantage of using namespaces at all? Why not replace >your > <x:foo xmlns:x="x"/> >with > <x-foo/> >which is even more compact and virtually identical in effect? Namespaces >have an advantage over concatenating to the name only when what's being >concatentated is relatively large, or not in XML name syntax, or carries >implications of globalness -- in other words, when the namespace's identity >is expressed as a URI or something similar. If your intent is not to place >the names in a namespace, don't abuse the namespace syntax. Here you are not considering the mnemonic effect for the designer of the dialect: It is important to be able to control the default namespace independent of local/shared status. If to have local names they have to be in the default namespace, that is a serious obstacle to mnemonic effectiveness of the names in the XML. >Finally, as the past month's debate has proven, using relative names does >not communicate well with humans attempting to read your document; there >are too darned many possible ways of interpreting this. Hardly. _Instances_ of relative references relate well to real people; The _class_ of relative references is harder to relate to in the abstract (as we have done here) because there is the _added dimension_ of the context within which the relative reference is posed. But short, relative references are far more mnemonic than unnecessarily global identifiers. Hands down. >I understand what you're trying to do; I've been tempted to do it myself >when just "hacking around" with namespaced documents, for the same reasons >that I've sometimes sloppily used a relative URIRef to point to my DTDs. >But I think I've convinced myself that in the case of namespaces it's >definitely a bad practice. > >>David is not the only Unix speaker who will use /dev/null as a "random >string" > >People can still do so. They just have to make their intent explicit by >saying "file:/dev/null". > > >>For locally-defined XSL extensions, local names are appropriate and >>XML-global names are not. > >Not so, actually. If you use purely local names, then someone else may use >the same name for a different purpose, and when you share your stylesheets >with them the error will be undetectable and the result will be >unpredictable. We can't prevent all such mistakes, but we can greatly >increase our odds of catching them before they damage data. > > > >I'm afraid that I'm having trouble finding a way in which the requirement >that namespaces be declared as absolute will really cause trouble. If >you've got a real-world example that can't be trivially solved by just >prefixing it with "file:/" or "ns:/" or something of that sort, please >post. > I am in favor of imposing software engineering discipline that will increase the reliance on common language. But you are merely introducing a nuisance which guarantees an ineffective [why bother?] level of globalization. The major battle lies on the right hand side of the data-description entries, not the left hand side. If people are not required to define the ontology that their stylesheets select on [html:class vocabulary, e.g.] and either use common terms [c.f. dc: vocabulary] or trace descent/distinctions from such terms, you haven't done anything noticeable for my clients. So why bother. References to local names, if we had local names, would be bound to name scope in the selector so that the style rules that use them would never fire in another document, anyway. Al
Received on Friday, 9 June 2000 09:55:47 UTC