2014-01-26 | Paul Boddie | raw annotate files changeset graph | Changed the origin of specific namespace defaults in XPath operations, initialising document-specific default namespaces in the document object instead of acquiring such defaults from the module namespace in the xpath method invocation. |
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