IWxWorkspace.LoadFromXml

Syntax

LoadFromXml(Xml: String);

Parameters

Xml. XML structure from which workspace state is loaded.

Description

The LoadFromXml method loads a workspace state from XML.

Comments

XML structure specifying in the Xml parameter must be obtained from the SaveToXml method execution results.

Example

Executing the example requires a workspace with the WSP identifier in repository. The workspace state was saved to the d:\WorkspaceState.xml file.

Add links to the Andy, Metabase, XML system assemblies.

Sub Button6OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Mb: IMetabase;
    Wsp: IWxWorkspace;
    XMLDoc: FreeThreadedDOMDocument60;
Begin
    Mb := MetabaseClass.Active;
    Wsp := Mb.ItemById(
"WSP").Edit As IWxWorkspace;
    XMLDoc := 
New FreeThreadedDOMDocument60.Create;
    XMLDoc.load(
"d:\WorkspaceState.xml");
    Wsp.LoadFromXml(XMLDoc.xml);
    (Wsp 
As IMetabaseObject).Save;
End Sub Button6OnClick;

On executing the example, the current workspace state will be loaded from the specified XML file. After that workspace will be saved to repository.

See also:
IWxWorkspace