[xsl] Merging Alternate readings...

Subject: [xsl] Merging Alternate readings...
From: James Cummings <James.Cummings@xxxxxxxxx>
Date: Mon, 31 Mar 2003 12:04:01 +0100 (BST)
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