[xsl] keys with Muenchian Method of grouping help

Subject: [xsl] keys with Muenchian Method of grouping help
From: Jinesh Varia <jineshresearch@xxxxxxxxx>
Date: Wed, 19 Feb 2003 08:45:15 -0800 (PST)
I read Jeni tennison's XML Muenchian Method grouping using keys.

I have a document which is something like this:
<publication pubid="0002">
<editor>fhjfhj </editor>
<publication pubid="00022">
<editor>fhjfhj </editor>
<publication pubid="00023">
<editor>fhjfhj </editor>

I want to list all the authors and editors seperately as 
outside the publication element.

//publication/author[not(.=preceding-sibling::publication/author or
or .=preceding-sibling::publication/editor)]

But this stupidly inefficient and bad style especially because I have around more than 500,000
author and editor nodes. and preceding siblings axis is taking like hours....
An expert suggested me to use keys.
I was trying to code them:

<xsl:key name="person" match="//publication/author or //publication/editor" use="author|editor" />
<xsl:apply-templates select="*[(author and generate-id(.)=generate-id(key('person',
author|editor)) or (editor and generate-id(.)=generate-id(key('person', author|editor)))]" />

Can anybody help me in devising this XPATH query please


Jinesh Varia
Graduate Student, Information Systems
Pennsylvania State University
Email: jinesh@xxxxxxx
'Self is the author of its actions.'

Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

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

Current Thread