// save file to XML
Var Sourcefile = "c: //manage.vsd";
Var TargetxmlFile = "D: //tmp/test.xml";
VAR ado_stream = new activXObject ("adodb.stream");
VAR XML_DOM = New ActiveXObject ("Microsoft.xmLDom");
XML_DOM.LOADXML (' XML Version = "1.0"?>
XML_Dom.documentelement.setttribute ("XMLns: DT", "URN: Schemas-Microsoft-COM: DataTypes");
Var l_node1 = XML_Dom.createElement ("file1");
l_node1.datatype = "bin.base64";
ADO_STREAM.TYPE = 1; // 1 = adtypebinary
ADO_STREAM.Open ();
ADO_STREAM.LOADFROMFILE (SOURCEFILE);
L_node1.nodetypedValue = ado_stream.read (-1); // -1 = adreadall
ADO_STREAM.CLOSE ();
XML_Dom.documentelement.Appendchild (l_node1);
XML_Dom.Save (TargetXmlfile);
// restore file from xml
Var Sourcefile = "c: //manage.vsd";
Var TargetxmlFile = "D: //tmp/test.xml";
VAR ado_stream = new activXObject ("adodb.stream");
VAR XML_DOM = New ActiveXObject ("Microsoft.xmLDom");
XML_DOM.LOADXML (' XML Version = "1.0"?>
XML_Dom.documentelement.setttribute ("XMLns: DT", "URN: Schemas-Microsoft-COM: DataTypes");
Var l_node1 = XML_Dom.createElement ("file1");
l_node1.datatype = "bin.base64";
ADO_STREAM.TYPE = 1; // 1 = adtypebinary
ADO_STREAM.Open ();
ADO_STREAM.LOADFROMFILE (SOURCEFILE);
L_node1.nodetypedValue = ado_stream.read (-1); // -1 = adreadall
ADO_STREAM.CLOSE ();
XML_Dom.documentelement.Appendchild (l_node1);
XML_Dom.Save (TargetXmlfile);