1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
Dim xmlDoc As Variant
Dim oCreation As Variant
Dim Root As Variant
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
Set oCreation = xmlDoc.createProcessingInstruction("xml", "version='1.0' encoding='ISO-8859-1'")
xmlDoc.InsertBefore oCreation, xmlDoc.ChildNodes.Item(0)
Set Root = xmlDoc.createElement("FFA")
xmlDoc.appendChild (Root)
'...... remplissage
'enregistrement /ecriture
Set rdr = CreateObject("MSXML2.SAXXMLReader")
Set wrt = CreateObject("MSXML2.MXXMLWriter")
Set oStream = CreateObject("ADODB.STREAM")
oStream.Open
wrt.indent = True
wrt.output = oStream
Set rdr.contentHandler = wrt
Set rdr.errorHandler = wrt
rdr.Parse xmlDoc
wrt.flush
oStream.SaveToFile XMLSaveName, 2
Set rdr = Nothing
Set wrt = Nothing
Set xmlDoc = Nothing |
Partager