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

Merging Alternate readings...

Subject: Merging Alternate readings...
From: James Cummings <James.Cummings@xxxxxxxxx>
Date: Mon, 31 Mar 2003 12:04:01 +0100 (BST)
alternate readings
Hi There,

Let's say I have a snippet of:

<foo>
<a id="a1"><body wit="A B C D E">This is a
 <app><rdg wit="A C D">test</rdg><rdg wit="B E">testament</rdg>, really.
</body></a>
<a id="a2"><body wit="A B C D E">This is a
 <app><rdg wit="A D">test</rdg><rdg wit="B C E">testament</rdg></app>,
a really <app><rdg wit="A E">long</rdg><rdg wit="B C">important</rdg>
<rdg wit="D">boring</rdg></app>test! </body>
<body wit="F">This is a different body element</body>
</a>
</foo>

And I want to output a list of merged-where-duplicate a/body elements
based on the @wit attribute.  So something like:
<foo>
<a id="a1">
<body wit="A C D">This is a test, really.</body>
<body wit="B E">This is a testament, really.</body>
</a>
<a id="a2">
<body wit="A">This is a test, a really long test!</body>
<body wit="B C">This is a testament, a really important test!</body>
<body wit="D">This is a test, a really boring test!</body>
<body wit="E">This is a testament, a really long test!</body>
<body wit="F">This is a different body element</body>
</a>
</foo>

I'm assuming it somehow involves an xsl:for-each based on the contents of
body/@wit to create an individual reading for each of these IDREFS,
but then how do you merge the duplicate ones back together?

Many thanks for any (hopefully detailed for the xslt-challenged) help,
-James

-- 
Dr James Cummings, James.Cummings@xxxxxxxxx, http://www.uea.ac.uk/~q503
Cursus Project, School of Music, University of East Anglia,
Norwich, Norfolk, NR4 7TJ, UK  Tel:(01603)593-595



 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.