Heres the code - the "secret" is to use something called XQL - XML Query Language - which allows one to get at those "duplication looking" tags with unique ID or NAME attributes.
XQL is to XML, what WQL is to WMI.
XQL is already built into Microsoft.XmlDom but warning - it can be a little fussy getting the exact syntax correct. but once nailed, its good to go.
Here is the code I just tested with your posted XML file:
Code:
Break On
$xml = XmlOpen(".\t.xml")
$filename1 = XmlReadValue($xml, "occasion/fotos/foto[@@nr='1']")
?"Filename1=" $filename1
$filename2 = XmlReadValue($xml, "occasion/fotos/foto[@@nr='2']")
?"Filename2=" $filename2
Exit 0
Function XmlOpen($filename)
$XmlOpen = CreateObject("microsoft.xmldom")
If Not $XmlOpen
Exit @ERROR
Endif
If Not $XmlOpen.Load($filename)
Exit @ERROR
Endif
EndFunction
Function XmlReadAttribute($xml, $path, $attrib)
Dim $node
$node = $xml.SelectSingleNode($path)
If $node
$XmlReadAttribute = $node.GetAttribute($attrib)
Endif
Exit @ERROR
EndFunction
Function XmlReadValue($xml, $path)
Dim $node
$node = $xml.SelectSingleNode($path)
If $node
$XmlReadValue = $node.Text
Endif
Exit @ERROR
EndFunction