[xsl] Grouping issue - multiple page break locations

Subject: [xsl] Grouping issue - multiple page break locations
From: "M V" <htmlhack@xxxxxxxxxxx>
Date: Mon, 03 Feb 2003 15:15:13 -0500
I've run into some problems with grouping that I hope someone can help me through. I've read just about every article and FAQ on grouping that I've been able to locate. I've also been through Michael Kay's and Jeni Tennison's books. I haven't been able to apply any of the examples successfully to this particular variation.

My source XML is structured like the following:

<book>
  <page number="1"/>
  <para>Page one, paragraph one.</para>
  <para>Page one, paragraph two.</para>
  <page number="2"/>
  <para>Page two, paragraph one.</para>
  <para>Page two, paragraph two, followed by a page break
     <page number="3"/> the continuation of page two, paragraph two.
  </para>
  <para>Page three, paragraph one.</para>
  <para>Page three, paragraph two, followed by a page break
     <page number="4"/> the continuation of page three, paragraph two.
  </para>
  <para>Page four, paragraph one.</para>
</book>

The page element in the souce can occur as a child of the root element or as a child of the para element. When it occurs within the para element, I need to close and then open the para element.

What I want to achieve is a page based hierarchy such as:

<book>
  <page number="1">
     <para>Page one, paragraph one.</para>
     <para>Page one, paragraph two.</para>
  </page>
  <page number="2">
     <para>Page two, paragraph one.</para>
     <para>Page two, paragraph two, followed by a page break</para>
  </page>
  <page number="3">
     <para>the continuation of page two, paragraph two.</para>
     <para>Page three, paragraph one.</para>
     <para>Page three, paragraph two, followed by a page break</para>
  </page>
  <page number="4">
     <para>the continuation of page three, paragraph two.</para>
     <para>Page four, paragraph one.</para>
  </page>
</book>

As I mentioned, I know there is a wealth of resources out there on grouping, but I just haven't been able to make them work for this particular case.

If anyone could help, it would be greatly appreciated!

Thanks,
Mattio

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread