xsl-list
[Top] [All Lists]

Combining two node Sets into one

2005-03-31 13:27:27
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



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