title: Error: <g> attribute transform: Expected '('
body: <p>Hope someone knows what to do and can help me:</p>
  
  <p>A function does this:</p>
  
  <pre><code>element.setAttributeNS(null, 'transform', s);
  if ('transform' in element.style) {
    element.style.transform = s;
  } else if ('-ms-transform' in element.style) {
    element.style['-ms-transform'] = s;
  } else if ('-webkit-transform' in element.style) {
    element.style['-webkit-transform'] = s;
  }
  </code></pre>
  
  <p>where "s" is this: 
   <code>s = 'matrix(' + matrix.a + ',' + matrix.b + ',' + matrix.c + ',' + matrix.d + ',' + matrix.e + ',' + matrix.f + ')'</code></p>
  
  <p>It works perfect with this.
  For hardware acceleration I want to add <code>+ ' translateZ(0)'</code> to "s".</p>
  
  <p>After doing this I get the following error:</p>
  
  <blockquote>
    <p>Error: &lt; g> attribute transform: Expected '(', "…39394) translateZ(0)".</p>
  </blockquote>
  
  <p>I also tried it without the "+" and directly connected. Maybe someone know what I'm doing wrong.  </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I changed "s" to: 
  <code>s = 'matrix3d(' + matrix.a + ',' + matrix.b + ',' + 0 + ',' + 0 + ',' + matrix.c + ',' + matrix.d + ',' + 0 + ',' + 0 + ',' + 0 + ',' + 0 + ',' + 1 + ',' + 0 + ',' + matrix.e + ',' + matrix.f + ',' + 0 + ',' + 1 + ')';</code> because of an idea of a co-worker. </p>
  
  <p>unfortunately same error: </p>
  
  <blockquote>
    <p>Error: &lt; g> attribute transform: Expected '(', "matrix3d(2.03961675842…".</p>
  </blockquote>