-1

In a for-each XSLT loop I construct an HTML structure of the form:

<div class="panel-group" id="accordion1" role="tablist" aria-multiselectable="true">
  <div class="panel panel-default">
    <div class="panel-heading" role="tab" id="heading001">
    ...
    </div>
  </div>
</div>

Is it possible in that loop to generate the suffix of the attributes id and assign to it? So that in first loop the IDs become "accordion1" and "heading001", in the second loop become "accordion2" and "heading002", etc? And if so, can you provide an example?

gfot
  • 95
  • 2
  • 11

1 Answers1

0

in your for each loop, example for the id do something like below

<xsl:attribute name="id">
   <xsl:value-of select="concat('accordion', position()"  />
 </xsl:attribute>
dansasu11
  • 875
  • 1
  • 9
  • 17