title: Can you use <xsl:for-each> to go through attributes?
body: <p>Is it possible to use the  command on attributes? I want this to be able to run without knowing the attribute names. Here's a quick (terrible) example:</p>
  
  <pre><code>&lt;candy hard="true" soft="false" stripes="true" solid="false"&gt;
  </code></pre>
  
  <p>In my head (this doesn't work) it should look something like this:</p>
  
  <pre><code>&lt;xsl:for-each select="candy/@[@='true']"&gt;
  </code></pre>
  
  <p>Is there a way around this to run through attributes without knowing their name, or do I need to write each attribute being looked at?</p>
  
  <p>Edit</p>
  
  <p>Heres an example of me trying to create a variable out of the attribute name where value='true'</p>
  
  <pre><code>&lt;xsl:for-each select="candy/@*[. = 'true']"&gt;
  &lt;xsl:attribute name="candytype"&gt; 
     &lt;xsl:value-of select="name()"/&gt; 
  &lt;/xsl:attribute&gt;
  &lt;xsl:text&gt; &lt;/xsl:text&gt;
  &lt;xsl:for-each&gt;
  </code></pre>