title: Make those functions ie9 compatible
body: <p>I tried those functions in ie9 ( well ie10 set as ie9 emulation ).
  in those functions "doc" is a svg document root element.
  addSvgTransform</p>
  
  <pre><code>  /**
     * Add a &lt;g&gt; element that envelop all SCG elements and makes the viewbox transformMatrix descend on all elements
     */
    function addSvgTransform(doc, matrix) {
      matrix[3] = matrix[0] = (matrix[0] &gt; matrix[3] ? matrix[3] : matrix[0]);
      if (!(matrix[0] !== 1 || matrix[3] !== 1 || matrix[4] !== 0 || matrix[5] !== 0)) return;
      // default is to preserve aspect ratio
      // preserveAspectRatio attribute to be implemented
      var el = document.createElement('g');
      while (doc.firstChild != null) {
        var node = doc.firstChild;
        el.appendChild(node);
      }
      el.setAttribute('transform','matrix(' + matrix[0] + ' ' + matrix[1] + ' ' + matrix[2] + ' ' + matrix[3] + ' ' + matrix[4] + ' ' + matrix[5] + ')');
      doc.appendChild(el);
    }
  </code></pre>
  
  <p>Failing point:
  el is a document.element.
  ie9 doesn't wan't to append to this kind of node any other node from our SVG and it doesn't want to do the contrary , appending this node to the Svg doc directly.
  our doc variable doesn't have a createElement method.
  Purpouse of this function is to add a 'G' element between root of the doc and all other elements</p>
  
  <p><strong>this is solved</strong> 
  doing var el = document.createElement('g'); ==> : var el = doc.ownerDocument.createElement('g');</p>
  
  <p>parseUseDirectives</p>
  
  <pre><code>  function parseUseDirectives(doc) {
      var nodelist = doc.getElementsByTagName('use');
      while (nodelist.length) {
        var el = nodelist[0],
            xlink = el.getAttribute('xlink:href').substr(1),
            x = el.getAttribute('x') || 0,
            y = el.getAttribute('y') || 0,
            el2 = doc.getElementById(xlink).cloneNode(true),
            currentTrans = (el.getAttribute('transform') || '') + ' translate(' + x + ', ' + y + ')',
            parentNode;
  
        for (var j = 0, attrs = el.attributes, l = attrs.length; j &lt; l; j++) {
          var attr = attrs.item(j);
          if (attr.nodeName === 'x' || attr.nodeName === 'y' || attr.nodeName === 'xlink:href') continue;
  
          if (attr.nodeName === 'transform') {
            currentTrans = currentTrans + ' ' + attr.nodeValue;
          }
          else {
            el2.setAttribute(attr.nodeName, attr.nodeValue);
          }
        }
  
        el2.setAttribute('transform', currentTrans);
        el2.removeAttribute('id');
        parentNode = el.parentNode;
        parentNode.replaceChild(el2, el);
      }
    }
  </code></pre>
  
  <p>This function is failing because doc doesn't have a doc.getElementById method.</p>
  
  <p>Edit: the problem here is that there ia nodesByID method of ie9. To use it i have to specify that id attribute is of type ID or XS:ID.
  To do that i have to add a xsd or dtd schema if i understood good.
  So i would like to add this notation before parsing the doc.
  What i should write?</p>
  
  <pre><code>&lt;xsd:attribute name="id" type="xsd:ID" /&gt;
  </code></pre>
  
  <p>Where? How? Any ideas, help?</p>