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

RE: Help Needed On Re-Organizing Structure

Subject: RE: Help Needed On Re-Organizing Structure
From: "Charles Gillanders" <charlesgillanders@xxxxxxxxxxxxxxx>
Date: Fri, 21 Apr 2006 18:01:35 +0100
charles gillanders
Thanks everyone for your advice.

I finally managed to sort this out based on using set differences as
suggested in the O'Reilly cookbook, I had to do an intermediate XSL
transformation first to re-arrange the formating of my source XML so the
whole thing is a two step process.

If it turns out to be really bad performance I might be back to seek
more help on how to merge the two XSL stylesheets into a single pass
process.....

Charles

-----Original Message-----
From: Wendell Piez [mailto:wapiez@xxxxxxxxxxxxxxxx]
Sent: 20 April 2006 16:33
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Help Needed On Re-Organizing Structure

Charles,

You should also look at the technique Jeni Tennison refined back in
2000, in the archives at

http://www.biglist.com/lists/xsl-list/archives/200012/msg00175.html

and also the XSL FAQ at

http://www.dpawson.co.uk/xsl/sect2/flatfile.html

In short, there are, in XSLT 1.0, two methods that are commonly used to
approach this problem, which we often label "positional grouping"
(elements must be grouped based on their relative positions):

1. "tree visitor" or "forward walk" - this is what Omprakash used.
When a "header" element is processed, conduct an explicit traversal of
the following-sibling axis, one node at a time, to include all its
"child" elements in a group with it.

2. key-based grouping (what Jeni used in the post above): use keys to
associate elements with the header element with which they should be
grouped. When you do the header, use a key to retrieve the elements that
belong with it into the group it makes.

Either technique works. Either can be conducted recursively to achieve
multiple levels of grouping.

In XSLT 2.0, the native grouping constructs make all this
prestidigitation quite unnecessary. (I'm sorry, but I can't help but
think of digital processing as counting on my fingers, really really
fast.)

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

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.