<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
...
<!-- 表示されない -->
<svg width="100" height="100">
<a xlink:href="http://www.mozilla.org/">
<rect x="0" y="0" width="100" height="100" fill="blue"/>
</a>
</svg>
<!-- 表示される -->
<svg:svg width="100" height="100">
<svg:a xlink:href="http://www.mozilla.org/">
<svg:rect x="0" y="0" width="100" height="100" fill="green"/>
</svg:a>
</svg:svg>
...
<html xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
...
<!-- 表示される -->
<svg width="100" height="100">
<a xlink:href="http://www.mozilla.org/">
<rect x="0" y="0" width="100" height="100" fill="blue"/>
</a>
</svg>
<!-- 表示されない -->
<svg:svg width="100" height="100">
<svg:a xlink:href="http://www.mozilla.org/">
<svg:rect x="0" y="0" width="100" height="100" fill="green"/>
</svg:a>
</svg:svg>
...
<html>
...
<!-- HTML と XHTML のどちらにも使えるマークアップ -->
<svg width="100" height="100"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<a xlink:href="http://www.mozilla.org/">
<rect x="0" y="0" width="100" height="100" fill="blue"/>
</a>
</svg>
...
<object data="support.svg" type="image/svg+xml" ...>...
<img src="support.svg" alt="SVG Support Chart">
.slide {
background: url(foxkeh.svg) bottom right no-repeat;
}
Robert O'ChallhanSVG Fonts --- at least the subset implemented in Opera and Webkit --- don't offer anything significant over downloadable Opentype (or WOFF) fonts ... except the last three points of the Acid3 test :-(. And people keep asking for it "because it's in SVG 1.1". But I don't think those are good enough reasons on their own to make SVG Fonts an essential part of the Web platform.
// svg: SVG 文書のルート svg 要素
// ctx: HTML 5 canvas の 2D コンテクスト
try {
ctx.drawImage(svg, 0, 0); // for Opera
} catch {
var text = svg.hasOwnProperty(xml) ? svg.xml : new XMLSerializer().serializeToString(svg);
var img = new Image();
img.src = 'data:image/svg+xml;' + encodeURI(xml);
ctx.drawImage(img, 0, 0); // for IE 9/WebKit/Firefox 4
}
var image = new Image();
image.src = ctx.canvas.toDataURL();