Looking at the RecordSet
You can navigate this recordset
like any other -
Do While Not objRS.EOF
Response.Write(objRS.Fields(0) & "<br>")
objRS.MoveNext
Loop |
Live
Demo |
This code will only print out the <Headline>
Tag. This is because the recordset is organized like this -
<table border="1"
width="100%">
<%
Response.Write("<tr>")
For Each fld in objRS.Fields
If fld.Name <> "$Text" Then
Response.Write("<td>" & fld.Name & "</td>")
End If
Next
Response.Write("</tr>")
Do While Not objRS.EOF
Response.Write("<tr>")
For Each fld in objRS.Fields
If fld.Name <> "$Text" Then
Response.Write("<td>" & fld.Value & "</td>")
End If
Next
Response.Write("</tr>")
objRS.MoveNext
Loop
%>
</table> |
Live
Demo |
We ignore the $Text column because it is the
entire record in one field so it doesn't look very nice.
Now you can navigate the XML file as if it was
a regular recordset.
Summary
With this solution, you'll find it much easier
to navigate XML files that can be tedious task using the XMLDOM.