MondeoST24
Member
- Joined
- Mar 9, 2006
- Messages
- 16
- Programming Experience
- Beginner
I have the following simple XML File called getvehicles.xml
I need to read the combined _make and combined_model tags. I have this codeDim file As String = Server.MapPath("getvehicles.xml")Dim doc As New XmlDocumentdoc.Load(file)Dim NodeList As XmlNodeListDim GetVehiclesNode As XmlNodeNodeList = doc.GetElementsByTagName("GetVehicle")For Each GetVehiclesNode In NodeListResponse.Write(GetVehiclesNode.Attributes("Combined_Make").InnerText)Response.Write(GetVehiclesNode.Attributes("Combined_Model").InnerText)Next But this returns an object not set to instance of an object error. What is the correct code.Many thanks, this is my first try with XML
HTML:
-?xml version="1.0" encoding="utf-8" ?--GetVehicles release="8.1" environment="Production" lang="en-US"--ApplicationArea--/ApplicationArea--DataArea--Error--/Error--Vehicles--Vehicle--Combined_Make>VOLVO-/Combined_Make--Combined_Model>70 SERIES C70 T5 GT-/Combined_Model--/Vehicle--/Vehicles--/DataArea--/GetVehicles-