[xsl] Creating a container?

Subject: [xsl] Creating a container?
From: Michael Müller-Hillebrand <info@xxxxxxxxxxxxx>
Date: Mon, 26 Nov 2001 21:30:26 +0100
Hello,

I am fairly new to XSL but have a special task to do. I'd like to ask all experts on the list for some starting advice, because currently I am blind in which direction to go (in parallel I am reading Michael Kay's book as well as some tutorials).

I have some very low level XML documents, which can be seen as just a sequence of elements with almost no hierarchy or container elements.

<chaptertitle>ABC</chaptertitle>
<para>...</para>
<note>...</note>
<para><img src=... /></para>
<heading1>...</heading1>
<para>...</para>
<note>...</note>
<para>...</para>
<para>...</para>
...
<chaptertitle>DEF</chaptertitle>
<para>...</para>
...

I know my life would be easier if I had container elements around each chapter's content, because finally I want to write each chapter into a separate file:

<chapter title="ABC">
  <para>...</para>
  ...
</chapter>
<chapter title="DEF">
  ...

My question is about which way to go:

* Trying to create a XSL stylesheet that operates on a sequence of elements ("all elements after <chaptertitle> until the next") -- if that is possible at all?

Or

* Trying to enhance the XML source with above mentioned container elements (using which tool?) before applying a XSL stylesheet?

Thanks you for any hints that help accelerate my learning [X?]path.

- Michael

--
cap studio
Redaktion "Schallplattenmann"  http://schallplattenmann.de
Gabelsbergerstr. 17            phone: +49-9131-28747
91052 Erlangen, GERMANY        fax:   +49-9131-28717
----------- computer assisted publishing -----------

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


Current Thread