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 query the file (I'm using xpath) to split the 'questions' element, check the position in which each number appears and check if it is number 1 or 2.
Basically I need to 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, thank you. I was going to edit the question as it was incorrect. I want to get, for example, all course names and codes whose 'questions' element (after split) has "2" in the second position, as in 1,2,2,1,1,1,2,1 Thanks!