eleazar wrote:
I made a set of 5 SVG emblems and 5 background shapes, according to the scheme laid out in my previous post. Note, some of the emblem graphics have partially transparent elements. Support for that is not neccesary, but could be interesting.
Get the
SVG flag graphics.I've been playing around with an XML parsing library for unrelated reasons, but since the SVG format is built on XML, I thought I'd try loading up a few SVG images as test input. The library I'm using is
TinyXML which is very light-weight, easy to incorporate and relatively simple to use compared to
some of the alternatives but it has an unfortunate limitation in its ability to parse <!DOCTYPE entries in XML files.
There are two interfaces for TinyXML, one of which can't handle any <!DOCTYPE tags, and the other which will ignore the tags unless they contain an <!ENTITY tag, in which case it will (sometimes?) crash. This means I can't load any of me SVG test images with the more restrictive interface, but I can load some images using the less restrictive one.
The SVG test images I've used include one
linked off the Wikipedia SVG article, and also the emblem03.svg in eleazar's pack of flag parts. The Wikipedia SVG doesn't have any <!ENTITY tags, but does have a <!DOCTYPE tag, so can only be parsed by the less restrictive TinyXML interface. eleazar's SVG has <!ENTITY tags, so fails with both.
Sometimes removing the <!DOCTYPE or <!ENTITY tags fixes the problems with the more restrictive interface, but sometimes it doesn't. The less restrictive interface seems to work with all my tests that don't have those flags (which can be made by removing the flags from an existing SVG file) and in some that do have <!DOCTYPE but no <!ENTITY tags.
So the question I have is, is it difficult or particularly awkward to save SVG files without any <!ENTITY or <!DOCTYPE tags? eleazar's SVG saved with (Adobe?) Illustrator has a large list of <!ENTITY tags in the <!DOCTYPE tag, which makes me worry it'd require a lot of hand-editing to get working.