Creating VML Documents

In Internet Explorer, VML is embedded in HTML documents. You start by declaring this namespace, v :

 <HTML xmlns:v="urn:schemas-microsoft-com:vml">      .     .     . 

You must also instantiate the VML engine, which is implemented as an Internet Explorer behavior. To implement this behavior, you use a <STYLE> element, connecting the v namespace to the VML default behavior:

 <HTML xmlns:v="urn:schemas-microsoft-com:vml">      <HEAD>         <TITLE>             Using Vector Markup Language         </TITLE>  <STYLE>   v\:* {behavior: url(#default#VML);}   </STYLE>   </HEAD>  .     .     . 

This indicates to Internet Explorer that the VML in the page should be handled by the VML engine. Now you can add VML elements such as <oval> if you use the proper namespace, v :

 <HTML xmlns:v="urn:schemas-microsoft-com:vml">      <HEAD>         <TITLE>             Using Vector Markup Language         </TITLE>         <STYLE>             v\:* {behavior: url(#default#VML);}         </STYLE>     </HEAD>     <BODY>         <CENTER>             <H1>                 Using Vector Markup Language             </H1>         </CENTER>         <P>  <v:oval STYLE='width:100pt; height:75pt'   fillcolor="yellow" />  <P>  <v:rect STYLE='width:100pt; height:75pt' fillcolor="blue"   strokecolor="red" STROKEWEIGHT="2pt"/>  <P>  <v:polyline   POINTS="20pt,55pt,100pt,-10pt,180pt,65pt,260pt,25pt"   strokecolor="red" STROKEWEIGHT="2pt"/>  </BODY> </HTML> 

I'll take a look at what VML elements are available now.



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net