Reputation: 2861
Looking at the following extract from an xml
file, if there are multiple instances of activity how would I use xpath to return the value of name
(Test Name
) where id attribute of activity contains 5WnweCI2lzT
?
<activity type="http://adlnet.gov/expapi/activities/module" id="http://5gISGNPekh5_course_id/5WnweCI2lzT">
<name lang="und">Test</name>
<description lang="und">Test</description>
</activity>
Upvotes: 0
Views: 55
Reputation: 1187
//activity[contains(@id,'5WnweCI2lzT')]/name/text()
Note that this will return multiple results where more than one node contains the identifier.
Upvotes: 3