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

RE: TOC Problem

Subject: RE: TOC Problem
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 03 Mar 2005 13:20:17 -0500
md duplicate toc
Frank,

At 09:31 AM 3/3/2005, you wrote:
THE PROBLEM:
Ok, i am able to fetch all the beginnings of the speeches per speaker. But
if i access a further speech of a speaker
, further means all speeches after the first one, the TOC is falsly extended
in this way:

Table Of Content
Joe.........1, 3, 7
Bob............2, 5
Joe........... 3, 7  <- false
Bob...............5  <- false
Joe...............7  <- false

So i have to memorize all the speakers i have already treated to treat them
not again. But i do not know how to memorize!?

That's why this is a grouping problem (which was my hint yesterday, and someone else's, I think).


An essential aspect of grouping is de-duplicating (boy do I wish there were another word for that ... I suppose "removing duplicates" might do), so that each group is processed once. If you do not de-duplicate your list of grouped items, each group is processed as many times as there are members of the group.

That's why you're getting three listings for Joe. If he appeared a fourth time you'd get a fourth listing.

Look again at those resources on grouping and see whether they don't help.

In particular, in XSLT/XPath it's not a matter of "memorizing" whether a name has been encountered already, but rather of selecting not "all names" but rather "all names *the first time they appear*". Having selected all names the first time they appear, you then proceed to process, for each of those names, all their appearances.

That's how they get grouped -- and this is, in fact, the essence of the "Muenchian method" of grouping in XSLT (which you will find to be well-documented).

Regards,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

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.