title: XSLT merge nodes attributes to one attribute
body: <p>I have this xml input and need to convert it to another xml (svg file), merging several node attributes to one attribute.</p>
  <p>Are there any solution with xsl ?</p>
  <pre><code>&lt;b&gt;
      &lt;h a=&quot;1&quot; b=&quot;2&quot; c=&quot;3&quot;/&gt;
      &lt;h a=&quot;4&quot; b=&quot;5&quot; c=&quot;6&quot;/&gt;
      &lt;h a=&quot;7&quot; b=&quot;8&quot; c=&quot;9&quot;/&gt;
  &lt;/b&gt;
  
  </code></pre>
  <p>Expected output:</p>
  <pre><code>&lt;g&gt;
      &lt;p d=&quot;1,2,3   4,5,6   7,8,9&quot;/&gt;
  &lt;/g&gt;
  
  </code></pre>
  <p>So tried to merge with an xsl (in fact several ...), but I can't find the trick ...</p>
  <p>Here is my last try, which only output the last element (7,8,9).</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
      &lt;xsl:template match=&quot;/b&quot;&gt;
          &lt;g&gt;
              &lt;p&gt;
                  &lt;xsl:apply-templates select=&quot;h&quot;/&gt;
              &lt;/p&gt;
          &lt;/g&gt;
      &lt;/xsl:template&gt;
      &lt;xsl:template match=&quot;h&quot;&gt;
          &lt;xsl:attribute name=&quot;p&quot;&gt;
              &lt;xsl:value-of select=&quot;concat(@a,' ',@b,' ',@c)&quot;/&gt;
          &lt;/xsl:attribute&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  <p>The output for this xsl:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;g&gt;&lt;p p=&quot;4 5 6&quot;/&gt;&lt;/g&gt;
  </code></pre>
  <p>thanks</p>