tmr232 / Ink2Impress

Create Impress.js presentations with Inkscape!
10 stars 4 forks source link

Use Inkscape-SVG #5

Open tmr232 opened 12 years ago

tmr232 commented 12 years ago

Currently, the plain-svg option in inkscape is used. It works, but has many limitations - any non-standard attribute (Inkscape's or custom) are removed from the final SVG. This makes storing meta-data quite difficult.

tmr232 commented 12 years ago

Basic testing shows that all custom SVG properties added in Inkscape are saved into the Inkscape-SVG file. Browser display for Inkscape-SVG still needs to be tested - does it need extra manipulations or not???

tmr232 commented 12 years ago

Just found how to overcome the xml-namespace issue!

>>> expr = "//*[local-name() = $name]"

>>> print(root.xpath(expr, name = "foo")[0].tag)
foo

>>> print(root.xpath(expr, name = "bar")[0].tag)
bar

>>> print(root.xpath("$text", text = "Hello World!"))
Hello World!

From lxml documentation, right before "Namespaces and prefixes". That is going to save me some coding :)