I am trying to parse an xml file with xslt.
I need to have the values grouped in a div tag.
First row the div tag should have a special class <div class="firstrow">
All other rows should have <div class="tabpanel">.
How can I assign the class=”firstrow” for first row and all other rows with class=”tabpanel”?
source xml
<row>
<column1>ABC</<column1>
<column2>ABC</<column2>
</row>
<row>
<column1>123</<column1>
<column2>123</<column2>
</row>
<row>
<column1>234</<column1>
<column2>234</<column2>
</row>
Output I want
<div class="firstrow">
ABC
ABC
</div>
<div class="tabpanel">
123
123
</div>
<div class="tabpanel">
234
234
</div>
Thanks
As simple as this:
When this transformation is applied on this XML document (the provided one, made well-formed!):
the wanted, correct result is produced: