

LINK: https://gambas-playground.proko.eu/?gist=a86ee7350648293efa4b4809dd5402bb

(BEISPIEL1) Ändern eines Element-Namens

Use "gb.xml"

Dim contents As String = "<xml>"
"<foo>"
"<p attr=\"1\">Hello</p>"
"<p attr=\"2\">Hi</p>"
"<p attr=\"3\">Greetings</p>"
"</foo>"
"</xml>"

Dim element As XmlElement
Dim doc As New XmlDocument
doc.FromString(contents)

(BEISPIEL1)
element = doc.GetElementsByTagName("p")[1] 'Get the second p element
element.Name = "div" 'Change its tag name
'Also available: element.TagName = "div"

Print doc.ToString(True)

