[xsl] Combining two node Sets into one

Subject: [xsl] Combining two node Sets into one
From: "Williamson, Chris" <cwilliamson@xxxxxxxxx>
Date: Thu, 31 Mar 2005 15:27:27 -0500
I am not sure if this is even possible with xsl and xpath alone but I am
limited to the fact that I can not change the xml schema.  Sooo.. I am stuck
asking for some help.. On to the question..

Is there any possible way to combine two node sets into one single node set
(assign to variable?) and then add an extra childnode to the set based on
which parent node the new node came from.  

ie..

Combine these..
<Disbs>
  <DisbDetail>
    <Damount>100</Damount>
    <Ddate>01/05/05</Ddate>
  </DisbDetail>
</Disbs>

<Refunds>
  <RefDetail>
    <Ramount>50</Ramount>
    <Rdate>01/30/05</Rdate>
  </RefDetail>
</Refunds>

Into..
 
<Trans>
  <TranDetail>
    <Ttype>dis</Ttype>
    <Tamount>100</Tamount>
    <Tdate>01/05/05</Tdate>
  </TranDetail>
  <TranDetail>
    <Ttype>refund</Ttype>
    <Tamount></Tamount>
    <Tdate>01/30/05</Tdate>
  </TranDetail>
</Trans>

So that I can create a template to loop through just the trans node set
ordered by date and output the results in order of date regardless if they
are a refund or a disbs... I must conserve whether it is a disb or refund so
that I can change background colors/fonts/etc.

If this is possible through grouping/etc let me know.. I am new to this
stuff.. :)

Chris

Current Thread