
On Sat, 2004-12-18 at 18:14, bulia byak wrote:
I must have missed something, but what is the reason? Our elements are already in the SVG namespace, even without any prefix, because that is the default namespace declared in the document's root. Why add the prefix?
I don't plan on changing anything about serialized documents (those we read or write), but how we represent in-memory documents.
As things are now, in-memory we've discarded (or at least ignore) all xmlns declarations and use fixed prefix<->namespace mappings.
Given this, if we use the absence of a prefix to mean the SVG namespace, we can't distinguish between the SVG namespace and an undefined default namespace.
The problem this creates becomes apparent when (for example) we're given a document that looks like this:
<blah:svg xmlns:blah="http://www.w3.org/2000/svg%22%3E blah:metadata <title>some title thing</title> </blah:metadata> <blah:rect ... /> </blah:svg>
We end up interpreting the document as if it had been:
<blah:svg xmlns:blah="http://www.w3.org/2000/svg%22%3E blah:metadata blah:titlesome title thing</blah:title> </blah:metadata> <blah:rect ... /> </blah:svg>
...which is wrong and violates the XML namespaces standard.
So, the change I want to make is to have us use a prefix internally for SVG like we do for other namespaces, so we can avoid this ambiguity.
It will also force us to make certain loading heuristics explicit in the code, rather than assumed all over the place, which is not a bad thing either.
-mental