Re: More on SVG within HTML pages

Jeff Schiller wrote:
> Maciej wrote:
>> (46 errors, specifically about the use of attributes from foreign
>> namespaces in a way that is not allowed by SVG 1.1 itself.)
> Am I misunderstanding something?  Actually that use of namespaced
> attributes and elements is perfectly valid from what I can see.
> "Attribute "sodipodi:version" is not a valid attribute"
> Why?  The sodipodi namespace and prefix have been declared on the root element?

The document in question uses a DTD, and does not validate against that 
DTD.  Being declared makes it well-formed XML complying with the 
Namespaces in XML specification.  DTD validity is an additional 
constraint on top of that.

Put another way, this is a namespace-well-formed SVG document:

   <svg xmlns=""
        my-random-attribute="I made this up"/>

It is not, however, valid SVG 1.1, if by "valid SVG 1.1" we mean 
"conforms to the SVG 1.1 DTD".

Of course SVG 1.1 section 23.1 basically says that SVG allows this sort 
of markup.  I can't tell you whether that means the SVG 1.1 DTD is buggy 
or whether section 23.1 is in error or whether something else bizarre is 
going on.  But if you feed an SVG document that contains attributes not 
declared in the SVG DTD through a DTD-based validator (like the W3C 
one), then it'll come up as invalid.  That's just the nature of the beast.


Received on Monday, 7 September 2009 21:23:23 UTC