IWxWorkspace.SaveToXml

Syntax

SaveToXml: String

Description

The SaveToXml method saves a workspace state to XML.

Comments

The method returns XML file contents as a string. Later, the obtained content can be saved to the file using the XML. The XML contents is also used by the LoadFromXml method to load workspace state.

Example

Executing the example requires a workspace with the WSP identifier in repository.

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

Sub UserProc;
Var
    Mb: IMetabase;
    Wsp: IWxWorkspace;
    XMLDoc: FreeThreadedDOMDocument60;
Begin
    Mb := MetabaseClass.Active;
    Wsp := Mb.ItemById(
"WSP").Bind As IWxWorkspace;
    XMLDoc := 
New FreeThreadedDOMDocument60.Create;
    XMLDoc.loadXML(Wsp.SaveToXml);
    XMLDoc.save(
"d:\WorkspaceState.xml");
End Sub UserProc;

On executing the example, the current workspace state will be saved to the specified XML file.

See also:

IWxWorkspace