Dim newDoc As DOMDocument: Set newDoc = New DOMDocument Dim FileImportNode As IXMLDOMNode Dim RollNode As IXMLDOMNode Dim FieldNode As IXMLDOMNode Dim AttributeNode As IXMLDOMAttribute Set FileImportNode = newDoc.createNode(NODE_ELEMENT, "FileImport", vbNullString) Set RollNode = newDoc.createNode(NODE_ELEMENT, "Roll", vbNullString) Set FieldNode = newDoc.createNode(NODE_ELEMENT, "Field", vbNullString) Set AttributeNode = newDoc.createAttribute("name") AttributeNode.Value = "NAME" FieldNode.Attributes.setNamedItem AttributeNode RollNode.appendChild FieldNode Set FieldNode = newDoc.createNode(NODE_ELEMENT, "Field", vbNullString) Set AttributeNode = newDoc.createNode(NODE_ATTRIBUTE, "description", "") AttributeNode.Value = "DESCRIPTION" FieldNode.Attributes.setNamedItem AttributeNode RollNode.appendChild FieldNode Set FieldNode = newDoc.createNode(NODE_ELEMENT, "Field", vbNullString) Set AttributeNode = newDoc.createNode(NODE_ATTRIBUTE, "date", "") AttributeNode.Value = "DATE" FieldNode.Attributes.setNamedItem AttributeNode RollNode.appendChild FieldNode FileImportNode.appendChild RollNode newDoc.appendChild FileImportNode newDoc.save "куда-нибудь" |