Build an SVG raw document containing all the necessary elements of the graphic, using XSLT
A natural option would be to use the onload event of the SVG root node of the document. But it comes out that this event is not triggered in Firefox if the SVG is not parsed but generated. As Boris Zbarsky points out in the Firebug Ticket #386856 that I had opened on this issue, this behaviour is conforming to the SVG spec. The spec states that the onload event should be triggered when the parsing of the element is completed. But for a programmatically generated SVG tree, there is no parsing.
I have sent this issue for further clarification to the mailing list of the W3C SVG working group. If onload is not appropriate for automatically generated SVG documents, a reliable alternative is necessary. Or should the spec be changed so that the onload event will be fired also for automatically generated graphics?
Here are the three alternatives:
XSLT-generated graphics, execution attached to <svg> onload
Contrary to Google Chrome, the graphic doesn't display correctly in Firefox.
XSLT-generated graphics, immediate script execution noted in the SVG tree
Instead of executing the script on load, it is embedded into the SVG XML, right before the closing </svg> node. In this case, Firefox and Chrome display the graphics properly.
SVG embedded as XML, script attached to <svg> onload
If the graphic is available as XML document, it displays properly on both browsers, since the onload handler is performed. But this is not a smart solution: The code of the SVG tree has to be duplicated for all horoscope graphics - redundancies are always bad. In particular since browsers can generate the tree dynamically with sufficient execution speed.
I used Firefox version 3.5.5 and Google Chrome version 188.8.131.525, both in their portable editions, to do these tests.