Manchmal kann man halt ein XML-File schneller mit dem Texteditor bearbeiten. Also ist es praktisch.
Das XML-File erstelle ich mit "DOMDocument" - also nicht mit normalen "Textdatei-zusammengebaue"
Hier der Beispiel-Code, hoffentlich kann mir jemenad den entscheidenden Tipp geben:
Set xml = New DOMDocument
xml.appendChild xml.createProcessingInstruction("xml", "version=""1.0"" encoding=""utf-8""")
Set xmlMenu = xml.appendChild(xml.createElement("Menue"))
Set xmlMenuInfo = xmlMenu.appendChild(xml.createElement("Info"))
With xmlMenuInfo
.setAttribute "Typ", "Info"
.setAttribute "Connection", "TCP/IP"
.setAttribute "ControlType", "S7"
.setAttribute "Language", "407"
.setAttribute "Created", Date
.setAttribute "ProjectName", "510234 Projektname"
Set xmlMenuInfoGroup = .appendChild(xml.createElement("MenueGroup"))
xmlMenuInfoGroup.setAttribute "MenuePrefix", "C"
xmlMenuInfoGroup.setAttribute "Prefix", "C"
Set xmlMenuInfoGroup = .appendChild(xml.createElement("MenueGroup"))
xmlMenuInfoGroup.setAttribute "MenuePrefix", "P"
xmlMenuInfoGroup.setAttribute "Prefix", "P"
Set xmlMenuInfoGroup = .appendChild(xml.createElement("MenueGroup"))
xmlMenuInfoGroup.setAttribute "MenuePrefix", "S"
xmlMenuInfoGroup.setAttribute "Prefix", "S"
End With
|