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

html subsection headers xpath

Subject: html subsection headers xpath
From: Jack Bates <ms419@xxxxxxxxxxxxxx>
Date: Wed, 03 Oct 2007 02:36:37 -0700
 html subsection headers xpath
I'm trying to select all the <h4> elements under the current <h3>
element, in a document which otherwise doesn't have any useful
structure.

This template selects <h4> elements following the current <h3> element:


  <xsl:template match="h3">
    <fieldset class="collapsible">
      <legend><xsl:value-of select="normalize-space(.)"/></legend>
      <xsl:apply-templates select="following::h4"/>
    </fieldset>
  </xsl:template>


How do I limit to <h4> elements following the current <h3> element, up
until the next <h3> element?

I assume I can generalize to: "select <h4> elements following the
current <h3> element, up until the next <h3>, <h2> or <h1> element"

Much thanks, Jack

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.