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

Re: two-level grouping xslt 2.0

Subject: Re: two-level grouping xslt 2.0
From: Terry Ofner <tofner@xxxxxxxxxxx>
Date: Thu, 28 Feb 2008 12:17:22 -0500
Re:  two-level grouping xslt 2.0
Sorry about the poor xml of the input. It was way too long to include
and my edit dropped off some closing </story> tags. I have tried to
fix in the output and input below.

Result should be:

<book>
<bodymatter>
<level1>
    <story>
        <cluster_num>Cluster ONE</cluster_num>
        <cluster_head>What Influences a Decision?</cluster_head>
        <thinking_skill>Thinking Skill analyzing</thinking_skill>
    </story>
    <story>
        <pagenum>13</pagenum>
    </story>
    <imggroup>
        <img src="DecisionsDecisions3-web-images/Field%20boy%
20final_fmt.jpeg" alt="missing image file"/>
    <prodnote/></imggroup>
    <story>
        <pagenum>14</pagenum>
    </story>
<level2>
    <story>
        <story-title>Playing God</story-title>
        <author>Ouida Sebestyen</author>
        <p class="initial-paragraph">He was ...</p>
        <p>So he wasnt going to get away without saying good-bye
after all...</p>
    </story>
</level2>

        <!--multiple story, image, and page elements edited out-->
<level2>
    <story>
        <story-title>TLA</story-title>
        <author>Jane McFann</author>
        <p class="initial-paragraph">I trudged down the hallway
of ...</p>
        <p ....</p>
        <!--etc-->
    </story>
</level2>
</level1>
<level1>
    <story>
        <cluster_num>Cluster TWO</cluster_num>
        <cluster_head>Good Decision or Bad Decision?</cluster_head>
        <thinking_skill>Thinking Skill evaluating</thinking_skill>
    </story>
    <story>
        <pagenum>51</pagenum>
    </story>
    <imggroup>
        <img src="DecisionsDecisions3-web-images/school%
20final_fmt.jpeg" alt="missing image file"/>
    <prodnote/></imggroup>
    <story>
        <pagenum>52</pagenum>
    </story>
<level2>
    <story>
        <story-title>A Kind of Murder</story-title>
        <author>Hugh Pentecost</author>
        <p class="initial-paragraph">...</p>
    </story>
</level2
</level1>
</bodymatter>
</book>

Terry Ofner
1541 Northbrook Drive
Indianapolis, IN 46260
Voice: 317-870-1992
Fax: 317-870-7101

tofner@xxxxxxxxxxx




On Feb 28, 2008, at 11:54 AM, Martin Honnen wrote:


Terry Ofner wrote:
I have been having trouble with this grouping problem:
Input:
<book>
<bodymatter>
    <story>
        <cluster_num>Cluster ONE</cluster_num>
        <cluster_head>What Influences a Decision?</cluster_head>
        <thinking_skill>Thinking Skill analyzing</thinking_skill>
    </story>
    <story>
        <pagenum>13</pagenum>
    </story>
    <imggroup>
        <img src="DecisionsDecisions3-web-images/Field%20boy%
20final_fmt.jpeg" alt="missing image file"/>
    <prodnote/></imggroup>
    <story>
        <pagenum>14</pagenum>
    </story>
    <story>
        <story-title>Playing God</story-title>
        <author>Ouida Sebestyen</author>
        <p class="initial-paragraph">He was ...</p>
        <p>So he wasnt going to get away without saying good-bye
after all...</p>
	</story>
        <!--multiple story, image, and page elements edited out-->
    <story>
        <story-title>TLA</story-title>
        <author>Jane McFann</author>
        <p class="initial-paragraph">I trudged down the hallway
of ...</p>
        <p ....</p>
	</story>
        <!--etc-->
    <story>
        <cluster_num>Cluster TWO</cluster_num>
        <cluster_head>Good Decision or Bad Decision?</cluster_head>
        <thinking_skill>Thinking Skill evaluating</thinking_skill>
    </story>
    <story>
        <pagenum>51</pagenum>
    </story>
    <imggroup>
        <img src="DecisionsDecisions3-web-images/school%
20final_fmt.jpeg" alt="missing image file"/>
    <prodnote/></imggroup>
    <story>
        <pagenum>52</pagenum>
    </story>
    <story>
        <story-title>A Kind of Murder</story-title>
        <author>Hugh Pentecost</author>
        <p class="initial-paragraph">...</p>
	</story>
</bodymatter>
</book>
I would like to group each <cluster_num> inside <level1> elements
and <story-title> inside <level2> elements

Can you post the result you want to generate from the above XML sample?

--

	Martin Honnen
	http://JavaScript.FAQTs.com/

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.