Subject: Re: [xsl] Grouping repeating elements From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 11 Jul 2001 11:57:07 +0100 |
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.
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 ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Grouping repeating elemen, Trevor Nash | Thread | Re: [xsl] Grouping repeating elemen, Trevor Nash |
Re: [xsl] Is it possible in XSLT --, Wendell Piez | Date | Re: [xsl] xsl:sort and xsl:key, Wendell Piez |
Month |