Let's say I have following list:
<list>
<item>text1</item>
<item>text2</item>
<item>text3</item>
<item type="type1">text4</item>
<item type="type1">text5</item>
<item type="type1">text6</item>
<item>text7</item>
<item>text8</item>
<item type="type2">text9</item>
<item type="type2">text10</item>
<item>text11</item>
<item>text12</item>
<item type="...">...</item>
...
<item>...</item>
...
</list>
One important things, that I don't know what value will have type attribute! It will be generated programmatically. Not this one. I know only that some items could have the same attribute.
And I want to transform this list into:
text1
text2
text3
text4, text5, text6
text7
text8
text9, text10
text11
text12
So, for each item, that does not have "type" attribute I output just text inside item. For each items that have the same attribute I output all items texts in one line. How to achieve this in xslt? And how to select all items that have the same attribute, when attribute is generated programmatically?