Loading ...
Sorry, an error occurred while loading the content.

66296Parsing SVG in python

Expand Messages
  • Pranav Lal
    Jan 13, 2014
    • 0 Attachment
      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
    • Show all 3 messages in this topic