title: Check attribute value of XML element with a regular expression pattern
body: <p>I have this code, which does not work.</p>
  
  <p>I want to iterate trough all <code>p</code> elements below the <code>body</code> element and look for an element named <code>object</code>. Then use the <code>match()</code> function to look for a certain pattern in the attribute node data.</p>
  
  <pre><code>&lt;xsl:template match="/xhtml:html/xhtml:body//xhtml:p"&gt;
      &lt;xsl:for-each select="xhtml:object[matches(@data,'*mov$')]"&gt;
          &lt;halloMovie&gt;&lt;xsl:value-of select="@data"/&gt;&lt;/halloMovie&gt;
      &lt;/xsl:for-each&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>Error message while executing with matches()</p>
  
  <blockquote>
    <p>[xslt] : Fatal Error! Could not compile stylesheet Cause: Error checking type of the expression 'funcall(matches, [step("attribute", 17), literal-expr(v$)])'.</p>
  </blockquote>
  
  <p>If I use the following line with the <code>contains()</code> function which works.</p>
  
  <pre><code>&lt;xsl:for-each select="xhtml:object[contains(@data,'.mov')]"&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>