3 ms·
Namespaces, as an abstract idea, are great. But I find XML's version confusing in practice. It's partly the several different ways of configuring defaults (four
by 8ren 16y ago
Namespaces, as an abstract idea, are great. But I find XML's version confusing in practice. It's partly the several different ways of configuring defaults (four I think), and partly the syntax.
You'd think they'd be as easy as Java:
set-and-forget defaults (eg. java.util.*); or
explicitly qualify everything (in import or in use).
In practice, collisions are rare.
Is it harder in XML because arbitrary XML documents are commonly nested? (which can't happen to Java source code)
- masklinn 16y ago> It's partly the several different ways of configuring defaults (four I think) Which ones? I only know of using the xmlns attribute to set a default namespace, though as I mention above (in my formatting-broken-by-HN text) attributes playing by completely different namespace rules is... annoying, to say the least. > Is it harder in XML because arbitrary XML documents are commonly nested? That's about the only difference, and I don't think it matters much, in my opinion (nor do I think Java's namespaces are very good). And XML namespaces are actually unique, unless you do very stupid things you can't have namespace collisions though you can have namespace-alias collisions (and as I noted above, using Clark's notation is a great way to understand how things actually work)