xsl-list
[Top] [All Lists]

[xsl] [xsl 1.0] howto merge branches by name

2011-12-14 14:21:29
Hi all,

Consider the following input XML file:

<test>
  <suite name="A">
    <case name="A">
      <procedure name="A" />
    </case>
  </suite>
  <suite name="A">
    <case name="A">
      <procedure name="B" />
    </case>
  </suite>
  <suite name="A">
    <case name="B">
      <procedure name="A" />
    </case>
  </suite>
</test>

I am trying to find a way to transform it into:

<test>
  <suite name="A">
    <case name="A">
      <procedure name="A" />
      <procedure name="B" />
    </case>
    <case name="B">
      <procedure name="A" />
    </case>
  </suite>
</test>

The branches are always 3-levels deep. That is: suite > case > procedure.

Please help,
Adrian.


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>