Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It should read <code>&lt;xsl:for-each select="attachment"&gt;...</code>. There is no <code>$</code> sign because <code>attachment</code> is the name of an XML element, not a variable.</p> <hr> <p><strong>EDIT after you've given the full XSLT and XML.</strong></p> <p>There are several problems with your XML:</p> <ul> <li>All tags should be closed.</li> <li>You may not use the <code>xmlns</code> for anything else that it's meant for — namespaces.</li> <li>You must have double quotes around the attribute values</li> </ul> <p>So a correct version of the XML file would be (for instance):</p> <pre><code>&lt;root&gt; &lt;attachment ptr="file1" /&gt; &lt;attachment ptr="file2" /&gt; &lt;/root&gt; </code></pre> <p>The XSLT file has some issues too:</p> <ul> <li>The <code>xsl</code> namespace should be bound to the exact URI <code>http://www.w3.org/1999/XSL/Transform</code>.</li> <li>You must have at least a <em>template</em> so that the XSLT transform processes your input XML document.</li> </ul> <p>A correct version would be, for instance:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:template match="/root"&gt; &lt;xsl:for-each select="attachment"&gt; &lt;a target="_blank" href="{@ptr}"&gt;&lt;xsl:value-of select="@ptr" /&gt;&lt;/a&gt; &lt;/xsl:for-each&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>I'm not sure it is exactly what you want, but for the above document it produces the following fragment:</p> <pre><code>&lt;a target="_blank" href="file1"&gt;file1&lt;/a&gt; &lt;a target="_blank" href="file2"&gt;file2&lt;/a&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload