xsl-list
[Top] [All Lists]

[xsl] html subsection headers xpath

2007-10-03 09:59:22
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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