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