There is a strange way of embeding svg, I've used once. For src attribute should be set a data:uri 64bit coded svg object. Somehow you should specify width and height, also add namespace and meta. Thus you create a separate svg-document and insert it to a page via embed tag. An other solution is to wait till IE, opera, chrome, safari, and firefox would support svg inside text/html file.
A:
Vladislav
2010-06-10 10:51:01
That doesn't really answer any of my questions. It is not very complicated to integrate SVG in a HTML5 document. My question was how to do it with XSL.
Kau-Boy
2010-06-10 11:00:52
+1
A:
You wrote:
But it is not HTML5 and without a DOCTYPE
Not true. From http://dev.w3.org/html5/html-author/
There are two syntaxes that can be used: the traditional HTML syntax, and the XHTML syntax
And
For XHTML, it is recommended that the DOCTYPE be omitted because it is unnecessary
To date there is no support for HTML5 in IE. The same applies to SVG (except by using plugins). It is clear then that IE is not your target browser.
Today I would not pay much attention to validator because HTML5 is a Working Draft.
Answer: Stay with XML serialization, this will give you full support for SVG.
Alejandro
2010-06-10 14:44:06
Thanks for poiting that out. I didn't know that I can leave out the doctype for HTML5. I also got it running just a few minues ago. I'll post the solution here. In the document you linked there are also alernative doctypes which might be easier to create with XSLT. And I know that IE doesn't support SVG yet, but as it is only a project that should show what is possible in HTML5 with SVG that's not an issue. Thanks again for your help.
Kau-Boy
2010-06-10 17:00:47
@Kau-Boy: From the Editor's Draft it's clear that there is not mandatory DOCTYPE. You could even use XHTML1.0 DOCTYPE! I'd like to see your demo, also.
Alejandro
2010-06-10 18:21:50
@Alejandro: Ok, I added my solution and a live demo you can try to validate.
Kau-Boy
2010-06-10 18:55:23