19/05/2023: A causa di un errore sono stati cancellati, insieme ad account creati da bot, alcuni account legittimi. Si prega di leggere qui: https://www.gambas-it.org/smf/index.php?topic=9733.0
Public Sub Main()Dim oRoot As XmlElementDim oDoc As XmlDocumentDim iVar As IntegerDim oReader As XmlReader oDoc = New XmlDocument oDoc.Open("language") oRoot = oDoc.Root Debug oRoot.Name Debug oRoot.Children.Count For iVar = 0 To oRoot.ChildElements.Max Print oRoot.ChildElements[iVar].GetAttribute("name") Print oRoot.ChildElements[iVar].GetAttribute("code") Print oRoot.ChildElements[iVar].GetAttribute("region") NextEnd
Public Sub Main()Dim oRoot As XmlElement Dim oDoc As XmlDocument Dim iVar As Integer Dim oReader As XmlReader oDoc = New XmlDocument oDoc.Open("cities.txt") oRoot = oDoc.Root Debug oRoot.Name Debug oRoot.Children.Count For iVar = 0 To oRoot.ChildElements.Max Print oRoot.ChildElements[iVar].GetAttribute("name") Print oRoot.ChildElements[iVar].GetAttribute("cod") ' should be "code" Print oRoot.ChildElements[iVar].GetAttribute("region") Next End
Print oRoot.ChildElements[iVar].GetAttribute("cod")
Print oRoot.ChildElements[iVar].Attributes["cod"]