You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by James Cummings <Ja...@uea.ac.uk> on 2003/07/30 12:42:01 UTC

Merging attribute values to unique list

Hi there,

I'm wondering the best way to do something in cocoon-2.1... assuming I have a
file along the lines of:

<foo id="a1">
<body wit="A B E D">some stuff</body>
<body wit="C A G">some other stuff</body>
</foo>

What I want to produce is a list of links one for each unique witness,
so in this case something like:

<p>See the reading for:
<a href="foo/a1.xml?wit="A">A</a>
<a href="foo/a1.xml?wit="B">B</a>
<a href="foo/a1.xml?wit="C">C</a>
<a href="foo/a1.xml?wit="D">D</a>
<a href="foo/a1.xml?wit="E">E</a>
<a href="foo/a1.xml?wit="G">G</a>
</p>

So, I'm assuming what needs to happen is that I need to somehow produce
a list of each of the tokenized contents of //body/@wit which are
then sorted and made unique. Any suggestions on how to go about this
without using loads of extensions or anything that is non-standard cocoon?
(Assuming that I know less java than a dazed gnat.)

-James

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



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Merging attribute values to unique list

Posted by "J.Pietschmann" <j3...@yahoo.de>.
James Cummings wrote:
> I'm wondering the best way to do something in cocoon-2.1..

This is a pure XSLT question. You'll find a variety of
tokenization code snippets in the XSL FAQ, reachable from
   http://www.mulberrytech.com/xsl/xsl-list/
You should also take a look eth the EXSLT tokenize() function,
which should be supported by Xalan (not sure about XSLTC, just
try it).
Further questions about this topic are best asked on the XSL
list.

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org