J
[Jongware]
I have a large table in XML, of the form (simplified)
<item><a>data1</a><b>more 1</b></item>
<item><a>data1</a><b>more 2</b></item>
<item><a>data2</a><b>more 3</b></item>
-- where I want the output to be
"data1: more 1, more 2
data2: more 3"
i.e., all <a> tags with the same contents grouped into one output item. I can
select them iterating over <item>, using sth like
<xsl:variable name="current_item" value="." />
<xsl:variable name="curr_subset" value=item[a=$current_item]" />
(that's OTOH; it looks like this, anyway), so I get subsets consisting of all
<a>'s containing "data1", "data2" etc. However. I get this subset _for each_ of
the <item>'s, so, for the above example, I get it *twice* for "data1".
I sense the logic, and yet it's somehow not what I intended. What am I missing?
(My XSLT proggie misses the 'unique' function, or whatever it is called--that'd
be an answer
[Jw]
<item><a>data1</a><b>more 1</b></item>
<item><a>data1</a><b>more 2</b></item>
<item><a>data2</a><b>more 3</b></item>
-- where I want the output to be
"data1: more 1, more 2
data2: more 3"
i.e., all <a> tags with the same contents grouped into one output item. I can
select them iterating over <item>, using sth like
<xsl:variable name="current_item" value="." />
<xsl:variable name="curr_subset" value=item[a=$current_item]" />
(that's OTOH; it looks like this, anyway), so I get subsets consisting of all
<a>'s containing "data1", "data2" etc. However. I get this subset _for each_ of
the <item>'s, so, for the above example, I get it *twice* for "data1".
I sense the logic, and yet it's somehow not what I intended. What am I missing?
(My XSLT proggie misses the 'unique' function, or whatever it is called--that'd
be an answer
[Jw]