LoadFromXml(Element: Variant);
Element. Object from which calendar parameters should be loaded.
The LoadFromXml method loads calendar parameters from XML code.
Use the ICalendarSetup.SaveToXml method to upload parameters to XML code.
Executing the example requires calendar dictionary with the CALENDARSETUP identifier. The file C:\CalendarSetup.xml should contain parameters of the dictionary with dynamically created elements. Add links to the Dimensions, Metabase and Xml system assemblies.
Sub UserProc;
Var
mb: IMetabase;
CalendarObj: IMetabaseObject;
Calendar: ICalendarDimension;
CalendDimInst: IDimInstance;
DynamicCalendInst: IDynamicCalendarInstance;
Setup: ICalendarSetup;
Node: IXmlDomElement;
DestXML: FreeThreadedDOMDocument60;
Begin
mb := MetabaseClass.Active;
CalendarObj := mb.ItemById("CALENDARSETUP").Edit;
Calendar := CalendarObj.Edit As ICalendarDimension;
CalendDimInst := Calendar.OpenAs(CalendarOpenType.Flat);
DynamicCalendInst := CalendDimInst As IDynamicCalendarInstance;
Setup := Calendar.Setup;
DestXML := New FreeThreadedDOMDocument60.Create;
DestXML.load("C:\CalendarSetup.xml");
Node := DestXML.documentElement;
Setup.LoadFromXml(Node);
CalendarObj.Save;
End Sub UserProc;
After executing the example parameters of the CALENDARSETUP calendar are loaded from the file C:\CalendarSetup.xml.
See also: