I am trying to group sibling data in an XML file.
Given :
-
This is easy to do when the following is true (which I assume it is):
- all
s within a
are unique
- only the
s right after a given
belong to it
- there is no
without a
element before it
This XSLT 1.0 solution:
produces:
team a v team b
team c v team d
team e v team f
team g v team h
team i v team j
team k v team l
Note the use of an
to match all
s that belong to ("are preceded by") a given
.
A slightly shorter but less obvious solution would be a modified identity transform:
- 热议问题