[code]// Load XML
Dim xml As New XmlDocument
Try
xml.LoadXml(kTestXml)
Catch e As XmlException
MsgBox("XML error: " + e.Message)
End Try
// Display all the Player names
Dim nodes As XmlNodeList
nodes = xml.XQL("//Player") // Find all Player nodes in XML
// Loop through results and display each name attribute
Dim node As XmlNode
For i As Integer = 0 To nodes.Length-1
node = nodes.Item(i)
MsgBox("Player: " + node.GetAttribute(“name”))
Next[/code]
asset id = your node attribute
“r2” = Your Attribute name
src=“file://Volumes/Media/MyVideo1.mov” = The Value
Here is a save i use for one of my projects
[code] Dim attr As XmlAttribute
Dim xRoot,lvl1,lvl2,lvl3,lvl4,lvl5,lvl6,lvl7 as xmlnode
Dim xName,xValue,tText,xID as string
Dim tname,tvalue,Cell_Name,Cell_Vallue as string
Dim nodes As XmlNodeList
nodes = xDoc.XQL("//farmSiloAmount")
Dim node As XmlNode
nodes = xVehicle.XQL("//onCreateLoadedObject") // Find all farms nodes in XML
Dim sum1,sum2 As Integer
For i As Integer = 0 To nodes.Length-1
node = nodes.Item(i)
if node.AttributeCount >0 then
For a as integer =0 to node.AttributeCount -1
attr=node.GetAttributeNode(a)
if attr.name ="ID" then
xID = node.GetAttribute("id")
if xID = wanimals1.Animal1 Then
node.SetAttribute("manureHeapFillLevel",wanimals1.txtmanureheap.text)
node.SetAttribute("numAnimals0",wanimals1.txtCows.text)
node.SetAttribute("liquidManureFillLevel",wanimals1.txtliquid.text)
end if
for x as integer=0 to node.ChildCount -1
lvl1= node.Child(x)
if lvl1.Name ="fillLevelMilk" then
// xName = lvl1.GetAttribute("fillLevel")
lvl1.SetAttribute("fillLevel",wanimals1.txtmilk.text)
end if
next
if attr.name ="id" then
xID = node.GetAttribute("id")
if xID = wanimals1.Animal2 Then
node.SetAttribute("numAnimals0",wanimals1.txtsheeps.text)
end if
end if
if attr.name ="id" then
xID = node.GetAttribute("id")
if xID = wanimals1.Animal3 Then
node.SetAttribute("numAnimals0",wanimals1.txtchicken.text)
wanimals1.txtchicken.Text =xName
end if
end if
end if
next
end if
next
Dim savefile2 As new FolderItem
savefile2 = SpecialFolder.ApplicationData.Child(“farmingsimulator2015”).Child(selectsavedGame).Child(“vehicles.xml”)
If savefile2 <> Nil Then
xVehicle.SaveXml(savefile2)
End If
[/code]