Parsing SVG in python
"Pranav Lal" <[email protected]> Tue, 14 Jan 2014 00:30:26 +0530
| Newsgroups | gmane.text.xml.svg.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
Is it possible to parse SVG in python? I was trying to use the following
code and not getting any output.
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
tree = ET.ElementTree(file='plan.svg')
root=tree.getroot()
for elem in tree.iter(tag='rect'):
print elem.tag, elem.attrib
The plan.svg file is at:
https://dl.dropboxusercontent.com/u/3688386/plan.svg
I have tried the above code with regular xml and the code works.
Pranav