If there is an XML comment (or processing instruction) buried in the SVG
document, this can cause recursivelyTraverseSvg() to issue a warning while
plotting about an element which needs to be converted to a path. This, because
the XML comment node shows up as an SVG "element" we don't recognize. (It's
not actually an XML "element" per se.)
Detecting this is easy enough in eggbot.py, albeit not immediately obvious. We
need to use an instanceof() check t see if the node's "tag" in the lxml.etree
we're traversing is of type "basestring" or not. If it is, then it's some sort
of XML element. If it isn't, then it's a processing direction or comment which
we can ignore.
>>> a=lxml.etree.XML("<a><!-- comment --><b/></a>")
>>> a[0].tag
<built-in function Comment>
>>> a[1].tag
'b'
>>> isinstance(a[0].tag, basestring)
False
>>> isinstance(a[1].tag, basestring)
True
>>>
Original issue reported on code.google.com by newman.d...@gmail.com on 17 Oct 2010 at 9:44
Original issue reported on code.google.com by
newman.d...@gmail.com
on 17 Oct 2010 at 9:44