SVG – Learning by Coding

[ doctype-features.svg --> Grafik anzeigen ]

  1: 
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
  2: 
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"

  3: 
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [

  4: 
  <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">

  5: 
  <!ENTITY tt "Das ist ein Testtext.">

  6: 
]>

​  7:   8: 
<!-- SVG Learning by Coding http://www.datenverdrahten.de/svglbc/ -->

  9: 
<!--    AuthorDrThomas Meinike 09/03 thomas@handmadecode.de     -->

​ 10: ​ 11:  12: 
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"

 13: 
  onload="DocInfos()">

​ 14:  15: 
  <title>SVG Learning by Coding</title>

 16: 
  <desc>SVG-Spezifikation in Beispielen</desc>

​ 17:  18: 
  <defs>

​ 19:  20: 
    <style type="text/css">

 21: 
      <![CDATA[

​ 22:  23: 
      g.stat

 24: 
      {

 25: 
        fill#00C;

 26: 
      }

​ 27:  28: 
      g.dyn

 29: 
      {

 30: 
        fill#F00;

 31: 
      }

​ 32:  33: 
      ]]>

 34: 
    </style>

​ 35:  36: 
    <script type="text/javascript">

 37: 
      <![CDATA[

​ 38:  39: 
      function DocInfos()

 40: 
      {

 41: 
        var d,pid,sid,wue,ent,nsp,xml1,xml2,css2,dom2,

 42: 
            ran2,vie2,evt2,uie2,tra2,mev2,mut2,dd,ver;

​ 43:  44: 
        d=document;

​ 45:  46: 
        // Daten abfragen

​ 47:  48: 
        dd=d.domain;

 49: 
        dr=d.referrer;

 50: 
        du=d.URL;

​ 51:  52: 
        if(d.doctype)

 53: 
        {

 54: 
          pid=d.doctype.publicId;

 55: 
          sid=d.doctype.systemId;

 56: 
          wue=d.doctype.name;

 57: 
          ent=d.doctype.entities.getNamedItem("tt").firstChild.nodeValue;

 58: 
          // d.doctype.notations liefert wie entities eine NamedNodeMap

 59: 
        }

​ 60:  61: 
        if(d.documentElement.namespaceURI)nsp=d.documentElement.namespaceURI;

​ 62:  63: 
        if(d.implementation)

 64: 
        {

 65: 
          xml1=d.implementation.hasFeature("XML","1.0");

 66: 
          xml2=d.implementation.hasFeature("XML","2.0");

 67: 
          css2=d.implementation.hasFeature("CSS","2.0");

 68: 
          dom2=d.implementation.hasFeature("Core","2.0");

 69: 
          ran2=d.implementation.hasFeature("Range","2.0");

 70: 
          vie2=d.implementation.hasFeature("Views","2.0");

 71: 
          evt2=d.implementation.hasFeature("Events","2.0");

 72: 
          uie2=d.implementation.hasFeature("UIEvents","2.0");

 73: 
          tra2=d.implementation.hasFeature("Traversal","2.0");

 74: 
          mev2=d.implementation.hasFeature("MouseEvents","2.0");

 75: 
          mut2=d.implementation.hasFeature("MutationEvents","2.0");

 76: 
        }

​ 77:  78: 
        if(getSVGViewerVersion())ver=getSVGViewerVersion();

​ 79:  80: 
        // Ergebnisse ausgeben

 81: 
        d.getElementById("t0").firstChild.nodeValue=pid;

 82: 
        d.getElementById("t1").firstChild.nodeValue=sid;

 83: 
        d.getElementById("t2").firstChild.nodeValue=wue;

 84: 
        d.getElementById("t3").firstChild.nodeValue=nsp;

 85: 
        d.getElementById("t4").firstChild.nodeValue=ent;

 86: 
        d.getElementById("t5").firstChild.nodeValue=xml1;

 87: 
        d.getElementById("t6").firstChild.nodeValue=xml2;

 88: 
        d.getElementById("t7").firstChild.nodeValue=dom2;

 89: 
        d.getElementById("t8").firstChild.nodeValue=css2;

 90: 
        d.getElementById("t9").firstChild.nodeValue=ran2;

 91: 
        d.getElementById("t10").firstChild.nodeValue=vie2;

 92: 
        d.getElementById("t11").firstChild.nodeValue=evt2;

 93: 
        d.getElementById("t12").firstChild.nodeValue=uie2;

 94: 
        d.getElementById("t13").firstChild.nodeValue=tra2;

 95: 
        d.getElementById("t14").firstChild.nodeValue=mev2;

 96: 
        d.getElementById("t15").firstChild.nodeValue=mut2;

 97: 
        d.getElementById("t16").firstChild.nodeValue=du;

 98: 
        d.getElementById("t17").firstChild.nodeValue=dd;

 99: 
        d.getElementById("t18").firstChild.nodeValue=dr;

100: 
        d.getElementById("t19").firstChild.nodeValue=ver;

101: 
      }

​102: 103: 
      ]]>

104: 
    </script>

​105: 106: 
  </defs>

​107: 108: 
  <text x="30" y="30" style="fill: #000; font-size: 24px">

109: 
    Informationen zu DOCTYPE und Features

110: 
  </text>

​111: 112: 
  <class="stat">

113: 
    <!-- statische Texte -->

114: 
    <text x="30" y="80">DOCTYPE-Public</text>

115: 
    <text x="30" y="100">DOCTYPE-System</text>

116: 
    <text x="30" y="120">Wurzelelement</text>

117: 
    <text x="30" y="140">Wurzel-Namespace</text>

118: 
    <text x="30" y="160">Entity-Zugriff (tt)</text>

119: 
    <text x="30" y="180">XML DOM Core 1.0</text>

120: 
    <text x="30" y="200">XML DOM Core 2.0</text>

121: 
    <text x="30" y="220">DOM Core 2.0</text>

122: 
    <text x="30" y="240">CSS 2.0</text>

123: 
    <text x="30" y="260">Range 2.0</text>

124: 
    <text x="30" y="280">Views 2.0</text>

125: 
    <text x="30" y="300">Events 2.0</text>

126: 
    <text x="30" y="320">UIEvents 2.0</text>

127: 
    <text x="30" y="340">Traversal 2.0</text>

128: 
    <text x="30" y="360">MouseEvents 2.0</text>

129: 
    <text x="30" y="380">MutationEvents 2.0</text>

130: 
    <text x="30" y="400">document.URL</text>

131: 
    <text x="30" y="420">document.domain</text>

132: 
    <text x="30" y="440">document.referrer</text>

133: 
    <text x="30" y="460">SVG-Viewer-Version</text>

134: 
  </g>

​135: 136: 
  <class="dyn">

137: 
    <!-- dynamische Texte -->

138: 
    <text id="t0" x="150" y="80"> </text>

139: 
    <text id="t1" x="150" y="100"> </text>

140: 
    <text id="t2" x="150" y="120"> </text>

141: 
    <text id="t3" x="150" y="140"> </text>

142: 
    <text id="t4" x="150" y="160"> </text>

143: 
    <text id="t5" x="150" y="180"> </text>

144: 
    <text id="t6" x="150" y="200"> </text>

145: 
    <text id="t7" x="150" y="220"> </text>

146: 
    <text id="t8" x="150" y="240"> </text>

147: 
    <text id="t9" x="150" y="260"> </text>

148: 
    <text id="t10" x="150" y="280"> </text>

149: 
    <text id="t11" x="150" y="300"> </text>

150: 
    <text id="t12" x="150" y="320"> </text>

151: 
    <text id="t13" x="150" y="340"> </text>

152: 
    <text id="t14" x="150" y="360"> </text>

153: 
    <text id="t15" x="150" y="380"> </text>

154: 
    <text id="t16" x="150" y="400"> </text>

155: 
    <text id="t17" x="150" y="420"> </text>

156: 
    <text id="t18" x="150" y="440"> </text>

157: 
    <text id="t19" x="150" y="460"> </text>

158: 
  </g>

​159: 160: 
</svg>

[zum Anfang]