[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl grouping help

Subject: xsl grouping help
From: "Vanessa Pacheco" <vssequeira@xxxxxxxxx>
Date: Fri, 8 Feb 2008 15:21:10 -0500
 xsl grouping help
Hello,

I just joined this group a minute ago, so I hope I'm sending this
message to the right address. I'm a newbie and hence struggling :-(

I need help with grouping. I have the following xml file structure

<!-- Begin xml file -->
<Client>
   <PersonID>
         <PersonIDNum>1290</PersonIDNum>
   </PersonID>
   <Program>
             <ClientHistory>
                    <IncomeCashSource>
                                <a>1</a>
                                <b>1.1</b>
                                <c>
                                     <d>1.3</d>
                                </c>
                    </IncomeCashSource>
                    <IncomeCashSource>
                                <a>2</a>
                                <b>2.1</b>
                                <c>
                                     <d>2.3</d>
                                </c>
                    </IncomeCashSource>
                    <IncomeCashSource>
                                <a>2</a>
                                <b>2.1</b>
                                <c>
                                     <d>2.3</d>
                                </c>
                    </IncomeCashSource>
             </ClientHistory>
   </Program>
   <Program>
             <ClientHistory>
                    <IncomeCashSource>
                                <a>1</a>
                                <b>1.1</b>
                                <c>
                                     <d>1.3</d>
                                </c>
                    </IncomeCashSource>
                    <IncomeCashSource>
                                <a>2</a>
                                <b>2.1</b>
                                <c>
                                     <d>2.3</d>
                                </c>
                    </IncomeCashSource>
                    <IncomeCashSource>
                                <a>3</a>
                                <b>3.1</b>
                                <c>
                                     <d>3.3</d>
                                </c>
                    </IncomeCashSource>
             </ClientHistory>
   </Program>
</Client>
<Client>
   <PersonID>
         <PersonIDNum>1291</PersonIDNum>
   </PersonID>
   <Program>
             <ClientHistory>
                    <IncomeCashSource>
                                <a>1</a>
                                <b>1.1</b>
                                <c>
                                     <d>1.3</d>
                                </c>
                    </IncomeCashSource>
                    <IncomeCashSource>
                                <a>2</a>
                                <b>2.1</b>
                                <c>
                                     <d>2.3</d>
                                </c>
                    </IncomeCashSource>
                    <IncomeCashSource>
                                <a>4</a>
                                <b>4.1</b>
                                <c>
                                     <d>4.3</d>
                                </c>
                    </IncomeCashSource>
             </ClientHistory>
   </Program>
   <Program>
             <ClientHistory>
                    <IncomeCashSource>
                                <a>1</a>
                                <b>1.1</b>
                                <c>
                                     <d>1.3</d>
                                </c>
                    </IncomeCashSource>
                    <IncomeCashSource>
                                <a>2</a>
                                <b>2.1</b>
                                <c>
                                     <d>2.3</d>
                                </c>
                    </IncomeCashSource>
                    <IncomeCashSource>
                                <a>3</a>
                                <b>3.1</b>
                                <c>
                                     <d>3.3</d>
                                </c>
                    </IncomeCashSource>
             </ClientHistory>
   </Program>
</Client>
<!-- End xml file -->

I have to group similar 'IncomeCashSource' records (having values of
<a>, <d> the same), within and across Programs for a single Client.
The resulting file should look something like this

<Clients>
  <Client>
     <Id>1290</Id>
     <IncomeCashSource>
               <a>1</a>
               <b>1.1</b>
               <c>
                    <d>1.3</d>
               </c>
     </IncomeCashSource>
     <IncomeCashSource>
               <a>3</a>
               <b>3.1</b>
               <c>
                    <d>3.3</d>
               </c>
     </IncomeCashSource>
  </Client>
  <Client>
     <Id>1291</Id>
     <IncomeCashSource>
            <a>1</a>
            <b>1.1</b>
            <c>
                 <d>1.3</d>
            </c>
      </IncomeCashSource>
     <IncomeCashSource>
             <a>2</a>
             <b>2.1</b>
             <c>
                <d>2.3</d>
             </c>
     </IncomeCashSource>
     <IncomeCashSource>
             <a>4</a>
             <b>4.1</b>
             <c>
                <d>4.3</d>
             </c>
     </IncomeCashSource>
     <IncomeCashSource>
             <a>3</a>
             <b>3.1</b>
             <c>
               <d>3.3</d>
             </c>
     </IncomeCashSource>
  </Client>
</Clients>

Please help. I'm exhausted and frustrated after trying for 2 days and
coming up with nothing
~Vanessa

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.