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

Re: Grouping repeating elements

Subject: Re: Grouping repeating elements
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 11 Jul 2001 11:57:07 +0100
Re:  Grouping repeating elements
Hi Till,

At 10:12 AM 7/11/01, Trevor wrote:
[snip]
Have a template matching "name".
In the body of this template create the target <person> element,
copying the matched <name> element, e.g. using copy-of.
To handle elements which always appear, use copy-of with
following-sibling to get the *first* element after the name of the
given type.  Get this working first, and see that 'phil' ends up with
age 28.  Make sure everyone gets just one age!
When you have that XPath right, you now have to add a condition that
the node you find matches the current <name> node and not a later one.
So, add a further condition that the <name> node before the one you
have found is the same node as the one matched in your template: use
preceding-sibling and generate-id().

Have a try at this yourself, if you get stuck ask again.

And after you've got it working, ask again and we'll tell you about the Advanced Technique using keys (the Topic of the Week) to simplify such "levitation" problems (by which I mean making implicit structures explicit)....


Cheers,
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
======================================================================


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.