Save(Element: IXmlDomElement);
Element. XML element, to which selection is saved.
The Save method saves selection to XML file.
To load selection from XML file, use the IDimSelection.Load method.
Executing the example requires that the repository contains a dictionary with the D_TO identifier and the D:\Documents.xml file to save the specified selection.
Add links to the Dimensions, Metabase, and Xml system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Dimen: IDimInstance;
Selection: IDimSelection;
XMLDoc: IXMLDOMDocument;
XMLName: String = "D:\Documents.xml";
XMLElem: IXMLDOMElement;
Begin
MB := MetabaseClass.Active;
Dimen := MB.ItemById("D_TO").Open(Null) As IDimInstance;
// Create an object containing dictionary selection
Selection := Dimen.CreateSelection;
// Add all dictionary elements to selection
Selection.SelectAll;
// Work with XML file
XMLDoc := New DOMDocument60.Create;
XMLElem := XMLDoc.createElement("Root");
XMLDoc.appendChild(XMLElem);
// Save selection to XML file
Selection.Save(XMLElem);
XMLDoc.save(XMLName);
End Sub UserProc;
After executing the example the specified element selection is saved to XML file.
See also: