xsl-list
[Top] [All Lists]

Re: [xsl] Problems grouping nested items within a completely flat structure

2014-08-06 09:03:29
Frank,
If these sections are truly nested, in other words "1st Section"
elements are section headings and "2nd Section" elements are
sub-section headings and "3rd section" elements are sub-sub-section
headings, etc., then what I wrote earlier has to be modified.

The modification required depends a good deal on the structure:
Are there always 4 levels of sections?
Is the first element after, for example, a 1st Section element always
a 2nd section element, or can you have some body text summarizing the
section before the sub-section begins, etc?

Feel free to send me an abbreviated/redacted version of the file you
are looking at, and I'll give it a go sometime.
-David




On Wed, Aug 6, 2014 at 3:37 PM, Wegmann, Frank
frank(_dot_)wegmann(_at_)softwareag(_dot_)com 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com>
wrote:


Hi David.



In principle, there could be deeply further nested lists. In fact, this is
not the case with the files at hand, so there are just two levels. But
chapters are nested five levels down: para[@pgftag=’Chapter’],
para[@pgftag=’1st Section’], ..., para[@pgftag=’4th Section’], and they are
all siblings of one another:-(

And my source file is about 5 MB large, so I need a scalable solution, my
own one wasn’t...



Frank



From: David Rudel fwqhgads(_at_)gmail(_dot_)com
[mailto:xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com]
Sent: Mittwoch, 6. August 2014 15:25
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Problems grouping nested items within a completely flat
structure



Frank,
One quick question: can the nested lists themselves have nested lists? I
gather from the way nested lists are handled in the source that they cannot,
or is there a separate type of @pgftag for each level of such a structure?
(First level = Bulleted text, Second Level = Bullet Sub, etc.)

Regardless of the above, a first step in trying to do this with a
for-each-group would be to use the group-starting-with attribute:

<xsl:for-each-group select="para"
group-starting-with="para[@pgftag=('Chapter','Body Text')]">



From a cursory look at your source and desired output, this would break the
elements into snippets that have a particular form of either a chapter
heading or a collection of non-list elements followed by a single list.

Then these individual snippets can be processed.



-David


Software AG – Sitz/Registered office: Uhlandstraße 12, 64297 Darmstadt,
Germany – Registergericht/Commercial register: Darmstadt HRB 1562 -
Vorstand/Management Board: Karl-Heinz Streibich (Vorsitzender/Chairman), Dr.
Wolfram Jost, Arnd Zinnhardt; - Aufsichtsratsvorsitzender/Chairman of the
Supervisory Board: Dr. Andreas Bereczky - http://www.softwareag.com

XSL-List info and archive
EasyUnsubscribe (by email)



-- 

"A false conclusion, once arrived at and widely accepted is not
dislodged easily, and the less it is understood, the more tenaciously
it is held." - Cantor's Law of Preservation of Ignorance.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>