HTML and CSS Reference
In-Depth Information
<p>
<svg:svg xmlns:svg=" http://www.w3.org/2000/svg " width="5em" height="4em"
viewBox="0 0 500 400" version="1.1">
<svg:title>A star</svg:title>
<svg:polygon style="fill:red; stroke:blue; stroke-width:10"
points="210,46 227,96 281,97 238,129
254,181 210,150 166,181 182,129
139,97 193,97" />
</svg:svg>
</p>
</body>
</html>
Developers have the freedom to change the parameter entities of the DTD if required. Since MathML and SVG
require additional support, the validity of the previous code does not guarantee that the document will be rendered
correctly by all web browsers.
SVG as the Host Language
A mixed document can be created by inserting XHTML and MathML into SVG with foreignObject (Listing 3-64).
Listing 3-64. An XHTML+MahtML+SVG Skeleton Document in SVG
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
" http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd " [
<!ENTITY % SVG.prefixed "IGNORE" >
<!ENTITY % XHTML.prefixed "INCLUDE" >
<!ENTITY % XHTML.prefix "xhtml" >
<!ENTITY % MATHML.prefixed "INCLUDE" >
<!ENTITY % MATHML.prefix "math" >
]>
<svg version="1.1" xml:lang="en"
xmlns=" http://www.w3.org/2000/svg "
xmlns:xlink=" http://www.w3.org/1999/xlink ">
<desc>SVG as the host language</desc>
<!-- ... SVG content ... -->
<switch>
<foreignObject width="800px" height="600px">
<xhtml:p xmlns:xhtml=" http://www.w3.org/1999/xhtml ">
<!-- ... XHTML content ... -->
<math:math xmlns:math=" http://www.w3.org/1998/Math/MathML " >
<!-- ... MathML content ... -->
</math:math>
<!-- ... XHTML content ... -->
</xhtml:p>
</foreignObject>
</switch>
<!--... SVG content ... -->
</svg>
 
Search WWH ::




Custom Search