xsl-list
[Top] [All Lists]

node traversal

2004-02-24 08:06:29
Hello all,
It's been quite a while since I've had the need to post a question here, since this is such a great list and the path to xsl bliss is usually found somewhere in the archive. I really commend those of you who give your time in so many many answering questions. It's quite altruistic (correct me if I'm wrong). Anyway, to my question.

I have a structure that _could_ be something like the following:
<stem>
         <table font-size="7">
               .....more tags.....
         </table>
<inline font-weight="bold" font-style="italic">Managerial accounting</inline>
          differs from financial accounting in that financial accounting is
<p indent="15" left-indent="8">This is a test. This is a test of the emergency everything system.</p> <p indent="10" left-indent="5">This is a second test. This is a test of the emergency everything system.</p>
         <math:math width="100" height="18" id="test01">
              ......more tags......
         </math:math>
         there could be another text node here, for example
         <math:math width="50" height="15" id="test02">
               .......more tags.....
         </math:math>
</stem>

and I have to get to the following:
<table:table-cell>
   <p>
       <table>etc.
    </p>
    <p>
<inline font-weight="bold" font-style="italic">Managerial accounting</inline>
          differs from financial accounting in that financial accounting is
    </p>
<p indent="15" left-indent="8">This is a test. This is a test of the emergency everything system.</p> <p indent="10" left-indent="5">This is a second test. This is a test of the emergency everything system.</p>
    <p>
       <math:math>etc.
    </p>
    <p>there could be another text node here, for example</p>
    <p>
       <math:math>etc.
    </p>
</table:table-cell>

The idea is that any <p> elements remain unchanged, groups of sequential <inline> and text nodes are grouped together in a <p> element and any other elements, e.g. <table>, <math:math>, etc., are each wrapped with a <p> element. I hope someone out there in xslt land can amaze me here where I haven't yet been able to amaze myself. :-)
I appreciate any pointers, solutions, etc.
If I can accomplish this, I will be able to successfully convert my own GleimML content format to an OpenOffice text format, and that would be very nice for our content editors since they could then edit content in a very user friendly manner. When they're done, it could be exported, i.e. "saved", back to GleimML with reasonable ease.
Much thanks in advance,

Matthew L. Avizinis <mailto:mla(_at_)gleim(_dot_)com>
Gleim Publications, Inc. <http://www.gleim.com>


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



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