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

Finding topmost element of a nested, nested list

Subject: Finding topmost element of a nested, nested list
From: "Liguori, Steven" <steven.liguori@xxxxxxxxxxx>
Date: Wed, 29 Oct 2003 08:31:48 -0600
steven liguori
As you'll see, I'm working on a process for print rendering. The basic idea
is that images, along with their immediate level(s) and section, should
start on a new page. A sample with the hoped for locations of the end-pages
is shown below.

I've been matching on level, looking for a descendant with matching criteria
before starting the process (the vast majority won't need it), and
outputting the end-page. I've been turning off the output when the level is
a descendant of another level. This is okay for level 3 but it obviously
won't work for level B which is the second child of the open level element.

I've tried various combinations of ancestors, descendants and position() but
still can't get this to work. Is this even possible with XSLT? Would I just
need the RIGHT combination of ancestor, descendant and position() tests?
Would changing the data model help? Any thoughts greatly appreciated.

<chapter>1.
  <level>I.
    <level>A.
      <section>1</section>
      <section>2</section>
    </level>
    <!-- end-page here -->
    <level>B.
      <section>3
        <image/>
      </section>
    </level>
  </level>
  <level>II.
    <level>A.
      <section>4</section>
    </level>
    <!-- end-page here -->
    <level>B.
      <section>5
        <image/>
      </section>
    </level>
  </level>
  <!-- end-page here -->
  <level>III.
    <level>A.
      <section>6
        <image/>
      </section>
    </level>
  </level>
</chapter>

Thanks again!
--Steve


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


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.