SVG format

i’m getting SVGs that wont load.

It seems that some of them have bogus namespace attributes on their tags. for example the outer “svg” tag is “svg:svg” and then all of the inner ones repeat the same namespace eg “svg:g”. Presumably you can have anything here (not sure) eg “moose:svg” followed by “moose:g”.

Anyhow, i’ve hacked my version to ignore any namespace (i dont do any consistency check and not sure if i care).


[code]bool XmlElement::hasTagName (const String& tagNameWanted) const noexcept
// ignore any namespace prefix (eg svg:svg, svg:g etc).
String t = tagName.fromLastOccurrenceOf(":", false, false);

// if debugging, check that the case is actually the same, because
// valid xml is case-sensitive, and although this lets it pass, it’s
// better not to…
if (t.equalsIgnoreCase (tagNameWanted))
jassert (t == tagNameWanted);
return true;
return false;
return t.equalsIgnoreCase (tagNameWanted);

fixes it for me.

Ta for the heads-up - I’ve added a fix for that now.