2012-01-29 | Paul Boddie | raw annotate files changeset graph | Improved/fixed transform attribute parsing and path data parsing. Added a test of transformations and paths. |
1 #!/usr/bin/env python 2 3 import libxml2dom.svg 4 5 d = libxml2dom.svg.parse("tests/test_svg_basic.xml") 6 g = d.xpath("//svg:g")[0] 7 8 matrix = g.getMatrixTrait("transform") 9 print matrix 10 11 p = g.xpath("svg:path")[0] 12 13 path = p.getPathTrait("d") 14 print path.segments 15 16 # vim: tabstop=4 expandtab shiftwidth=4