I have the following xml file:
<courses> <course> <name>Course 1</name> <code>00162</code> <questions>2,2,1,1,2,1,1,1</questions> </course> </courses>
I need to request a file (I use xpath) to separate the βquestionsβ element, check the position in which each number is displayed, and check if it is number 1 or 2.
Basically I need this in xpath:
Dim ints As String() = QuestionsString.ToString.Split(",") Dim i As Integer For i = 0 To UBound(ints) If ints(i) = "2" Then 'do something Else 'do something else End If Next
Update from comments
Hi thanks I was going to edit the question as it was wrong. I want to get, for example, all course names and codes, whose question item (after the split) has "2" in the second position, as in 1, 2 , 2,1,1,1,1,2,1 Thank you!
split xml xpath
netNewbi3 Apr 12 '11 at 10:45 2011-04-12 10:45
source share