I want to Embed SVG into XUL. I tried to use the this tutorial which requires pasting of the SVG code in XUL application and it works but this is not clean. I want to keep SVG and XUL files separate, further I will like to use a separate CSS file for SVG part, any examples how we can do this?
Share
You can use xul-overlays:
1) Declare the overlay at the top of your xul file:
2) Define an empty container svg element inside your xul file and assign the same id to it as to the main svg element in the included file.
3) Remember to use a separate namespace for the svg part (see svg:svg above) and declare it.
4) Make your svg file an overlay by putting an overlay declaration all around (I’m afraid you have to do this).
About separate css files: Just create two of them and include them wherever you want – even in the svg overlay.
You might want to look inside a working example – a small geography quiz which I created years ago and just updated yesterday to make it work again in current firefoxes:
http://open-projects.net/~nico/countryquiz/
Just look at the source files!