title: Symfony2 Twig and XSL
body: <p>I am developing an application using symfony2 and twig for templates. The problem comes when trying to use Twig in a XSL file. This is the XSL code with Twig:</p>
  
  <pre><code>    &lt;?xml version='1.0' encoding='ISO-8859-1'?&gt;
      &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
      {# src/Anotatzailea/AnotatzaileaBundle/Resources/views/Page/testuaanotatu.html.twig #}
      {% extends 'AnotatzaileaAnotatzaileaBundle::layout.html.twig' %}
  
      {% block title %}Testua anotatu{% endblock%}
  
      {% block body %}
  
      &lt;div class="box600_lower"&gt;
       &lt;xsl:template match="word"&gt; 
         &lt;label&gt;
          &lt;xsl:attribute name="class"&gt;
             &lt;xsl:text&gt;annotation_checkbox&lt;/xsl:text&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="id"&gt;
             &lt;xsl:text&gt;Ascripta&lt;/xsl:text&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="name"&gt;
             &lt;xsl:text&gt;Bscripta&lt;/xsl:text&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="value"&gt;
             &lt;xsl:text&gt;Cscripta&lt;/xsl:text&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="type"&gt;
             &lt;xsl:text&gt;checkbox&lt;/xsl:text&gt;
          &lt;/xsl:attribute&gt;
         &lt;/label&gt;
         &lt;label&gt;
          &lt;xsl:attribute name="class"&gt;
             &lt;xsl:text&gt;altcheckboxoff&lt;/xsl:text&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="for"&gt;
             &lt;xsl:text&gt;Ascripta&lt;/xsl:text&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:attribute name="id"&gt;
             &lt;xsl:text&gt;Bscripta&lt;/xsl:text&gt;
          &lt;/xsl:attribute&gt;
          &lt;xsl:value-of select="text()"/&gt;
          &lt;xsl:text&gt; &lt;/xsl:text&gt;
          &lt;/label&gt;
       &lt;/xsl:template&gt;
      &lt;/div&gt;
      {% endblock %}
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>The code fails and shows the next message:</p>
  
  <p>Warning: XSLTProcessor::importStylesheet(): compilation error: file /var/www/Symfony/web/MyXSLFile.xsl line 12 element template </p>