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

keys with Muenchian Method of grouping help

Subject: keys with Muenchian Method of grouping help
From: Jinesh Varia <jineshresearch@xxxxxxxxx>
Date: Wed, 19 Feb 2003 08:43:28 -0800 (PST)
muenchian method
hello,
I read Jeni tennison's XML Muenchian Method grouping using keys.

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

I want to list all the authors and editors seperately as 
<person><personname>asdfasdf</personname></person> 
outside the publication element.

//publication/author[not(.=preceding-sibling::publication/author or
.=preceding-sibling::publication/editor)]|//publication/editor[not(.=preceding-sibling::publication/author
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

thanks
Jinesh






=====
-----------------------------------------------------------------
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
http://shopping.yahoo.com

 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.