From the "Namespaces Crash Course" by Mozilla: "sometimes it is necessary to define parameters so that they can be reused on many different elements and still be considered to be the same parameter, independently of the element with which they are used."
The example given:
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<script xlink:href="cool-script.js" type="text/ecmascript"/>
</svg>
Can someone give me an example of why you would namespace a parameter? I'm seeing that they're referencing the xlink namespace, and associating just the href parameter with xlink. But that implies that the element itself is of a separate namespace than the parameter.
Also, apparently SVG 2.0 is deprecating the use of Xlink in favor of a plain ole href attribute. This means you can remove the xlink:
from xlink:href
. Were you just not able to link SVG elements without it before 2.0? Is it like a mixin, where you can add new properties from other xml tools ("dialects") into elements, sort of like injecting an element with steroids or nootropics to make it better?
The idea was that linking was a common capability and multiple specifications would use it. This never really took off which is why it's basically been abandoned in favour of putting everything in one namespace.
Let's say you have an XML file that describes dogs and trees because dogs like to fetch sticks from particular trees.
So dogs have a bark attribute and so do trees. Maybe that's OK except that someone puts a wooden dog that makes a barking sound in the inventory.
Namespaces would allow you to have a noise namespace and a tree namespace and have tree:bark or noise:bark so you knew which attribute was which.