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

Grouping on multiple nested elements

Subject: Grouping on multiple nested elements
From: PAUL DICKINSON <dickinson.paul@xxxxxxxxxx>
Date: Tue, 16 Jul 2002 17:29:21 +1000
paul dickinson
Dear all,

I have XML data like 

<?xml version="1.0"?>
<data>
<story>
  <story_id>589608</story_id>
  <story_title>It's Only Human Nature</story_title>
  <program_name>Science Show</program_name>
  <transmission_date>20020629</transmission_date>
  <description>What is human nature? Who really knows?</description>
  <subjects>
    <subject>Psychology</subject>
    <subject>Health</subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
  </subjects>
</story>
<story>
  <story_id>591325</story_id>
  <story_title>Fins responsible for Hyshot crash</story_title>
  <program_name>Science News</program_name>
  <transmission_date>20020627</transmission_date>
  <description>The failure of a set of fins on the launch rocket was likely
to be the cause of the Hyshot scramjet crash in October 2001, according to
the final report of the investigation released last week. The finding
clears the way for a second launch.</description>
  <subjects>
    <subject>Australian</subject>
    <subject>Space</subject>
    <subject>Engineering</subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
  </subjects>
</story>
<story>
  <story_id>591756</story_id>
  <story_title>Immunisation gets bad rap on internet</story_title>
  <program_name>Science News</program_name>
  <transmission_date>20020627</transmission_date>
  <description>The internet has an abundance of websites that are negative
towards vaccination and tend to rely on unscientific evidence according to
two separate studies published this week.</description>
  <subjects>
    <subject>Australian</subject>
    <subject>Health</subject>
    <subject>Information Technology</subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
    <subject></subject>
  </subjects>
</story>
</data>

(but more) and I am attempting to output stories grouped by their
subject(s) e.g.

Australian

	story title
	description

	story title
	description

	...

Health

	story title
	description

	...

Space

	...


I have no problem grouping by program_name using the Muenchian method -
there is only one program_name for each story. However, grouping by subject
has me stumped - do I need multiple keys and how do I keep track of the
current subject?

Apologies if this has been covered previously but I have search the
archives in vain.

Regards
Paul Dickinson
ABC Online 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.