Howdy --

I'm having difficulty crafting a tricky XPath expression and would appreciate 
help from any XPath gurus out there.

Sample document:

<IDMS>
  <identity idms_id="900000282">
    <sponsorship status="Inactive" start_date="Jul 20 
2004">Provost</sponsorship>
    <sponsorship status="Active" start_date="May 28 2004 
">Residents</sponsorship>
  </identity>
  <identity idms_id="900018891">
    <sponsorship status="Active" start_date="May 6 2003">HR</sponsorship>
    <sponsorship status="Active" start_date="May 9 2003">Provost</sponsorship>
    <sponsorship status="Active" start_date="May 8 2003">UMA</sponsorship>
  </identity>
</IDMS>

I need an XPath expression that will extract the array of <identity> elements 
with Active Provost sponsorship.

Applying the expression I seek against the above document would yield a 
one-element array containing only the second
<identity> element from the document.

Extracting the <identity> elements with Provost sponsorship is trivial:

/IDMS/identity[sponsorship='Provost']

The tricky part seems to be restricting the selection to only the *Active* 
Provost sponsorships.

I've tried a zillion permutations on the following as the second argument to my 
XMLSearch() call, but none of my
experiments has worked right yet:

/IDMS/identity[sponsorship='Provost' and [EMAIL PROTECTED]'Active']]

I've looked through all the XPath tutorials I could find but couldn't find an 
answer to this question (at least, not an
answer I could understand).  Looking at some complex examples I've found in 
some tutorials, I've gotten a vague sense
that somehow "id()" and "self::" are going to be involved in a solution, but 
otherwise I'm just totally lost.

Greatly appreciate any help anyone can provide.

-- Larry Afrin
   Medical University of South Carolina



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227167
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to