xsl-list
[Top] [All Lists]

Re: [xsl] group together subsequent elements?

2012-03-17 06:14:20
On Sat, Mar 17, 2012 at 12:04:46PM +0100, Matěj Cepl scripsit:
I am probably missing something very obvious, but I have not found a
way how to combine group of same elements into one. Meaning, I have
on input

n.: <spoj>mám</spoj> <spoj>zalíbení</spoj>

and I would like to get on output

n.: <linked>mám zalíbení</linked>

(number of elements in one group can vary).

Do I miss something completely trivial or it is one of those things
which XSLT cannot do?

You're not combining elements, you're putting the text node content of
more than one element in the input into one element in the result tree.

A template match on "spoj/text()" will give you no white space, so you
should iterate using for-each and add the spaces.

-- Graydon

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--