eliom icon indicating copy to clipboard operation
eliom copied to clipboard

SVG content in Eliom

Open izderadicka opened this issue 11 years ago • 6 comments

Hi, recently I have couple issues with SVG content (maybe they are just result of my misunderstanding of the problem):

a) Adding svg element into HTML content (using functional interface) : svg element is different type then html element. I used F.tot (Svg.F.toelt my_svg_elt), but not sure if this is right, because then I had some problems as described in next item.

b) By default eliom pages are served with content type application/xhml+xml. But with this type browser (FF, Chome) ignores my svg element. If I chaged content type to text/html then everything worked as expected. Playing bit around I've found that svg elem in xhml page should have namespace defined ( xmlns="http://www.w3.org/2000/svg"), do not know how to get it there.

This leads me to couple of question: Is there some global option to force all content to be text/html?
How to correctly include svg element into page? How to ensure that svg element will have correct namespace in serialized xhtml?

Thanks Ivan

izderadicka avatar Dec 25 '14 12:12 izderadicka

a) Use F.svg (and the elements from Svg.F inside).

b) The namespace issue should be fixed in last tyxml.

Drup avatar Dec 25 '14 17:12 Drup

Thanks,

works like charm now. Somehow did not realize that svg element is also in Html5.F

I.

On 25.12.2014 18:19, Gabriel Radanne wrote:

a) Use F.svg (and the elements from Svg.F inside).

b) The namespace issue should be fixed in last eliom.

— Reply to this email directly or view it on GitHub https://github.com/ocsigen/eliom/issues/165#issuecomment-68108578.

izderadicka avatar Dec 26 '14 17:12 izderadicka

Nice. :)

I'm letting this open as a reminder to add a HOWTO.

Drup avatar Dec 26 '14 17:12 Drup

Anything new on this? I’m beginning with Ocsigen and struggling with the same issue (SVG in HTML).

bfontaine avatar Feb 29 '16 23:02 bfontaine

What's your issue ? The original issue is solved.

Drup avatar Feb 29 '16 23:02 Drup

I’m talking about the HOWTO; I’d be great to have an example of code in the documentation that deals with SVG in HTML.

bfontaine avatar Feb 29 '16 23:02 bfontaine