[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] XPath for all of an element type prior to context node?


Subject: [xsl] XPath for all of an element type prior to context node?
From: Michael Strasser <M.Strasser@xxxxxxxxxxxxx>
Date: Thu, 01 Mar 2001 17:46:45 +1000

Here's a bit of XPath that is too tricky for me.

Given this simplified XML document (empty elements for clarity):

<?xml version="1.0" encoding="UTF-8"?>
<course>
  <resources/>
  <module>
    <case>
      <resources/>
      <qatr>
        <question id="q001"/>
        <compare id="c001"/>
        <revise id="r001"/>
      </qatr>
    </case>
    <reflection>
      <resources/>
      <qatr>
        <question id="q002"/>
      </qatr>
    </reflection>
    <challenges>
      <resources/>
      <qatr>
        <question id="q003"/>
        <compare id="c003"/>
        <revise id="r003"/>
      </qatr>
    </challenges>
    <evaluation>
      <qatr>
        <question id="q004"/>
        <compare id="c004"/>
        <revise id="r004"/>
      </qatr>
    </evaluation>
  </module>
</course>

When the context node is any of those with an id attribute, I want a way to
get the list of resources nodes that occur:

- before the context node; or
- after the context node.

Please let me know if this request isn't clear.

Thanks in advance for any help.

-- 
Michael Strasser
Brisbane, Australia

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



Current Thread
Keywords