IMsFormulaTransform.SaveToXml

Fore Syntax

SaveToXml(Xml: IXMLDOMElement);

Fore.NET Syntax

SaveToXml(Xml: Prognoz.Platform.Interop.MsXml2.IXMLDOMElement);

Parameters

Xml. Object, to which the model parameters are output.

Description

The SaveToXml method saves model parameters to XML.

Fore Example

Executing the example requires that the repository contains a modeling container with the MS identifier containing a model with the OBJ_MODEL identifier.

Add links to the Metabase, Ms, Xml system assemblies.

Sub UserProc;
Var
    model: IMsModel;
    node: IXmlDomElement;
    mb: IMetabase;
    cl: FreeThreadedDOMDocument60;
    msKey: Integer;
Begin
    mb := MetabaseClass.Active;
    msKey := mb.ItemById(
"MS").Key;
    model := (mb.ItemByIdNamespace(
"OBJ_MODEL", msKey)).Bind As IMsModel;
    cl := 
New FreeThreadedDOMDocument60.Create;
    node := cl.createElement((model 
As IMetabaseObjectDescriptor).Id);
    cl.appendChild(node);
    model.Transform.SaveToXml(node);
    Debug.WriteLine(node.xml);
End Sub UserProc;

After executing the example the OBJ_MODEL model parameters represented as XML code are displayed in the Memo1 component.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.MsXml2;

Public Shared Sub Main(Params: StartParams);
Var
    model: IMsModel;
    node: IXmlDomElement;
    mb: IMetabase;
    cl: FreeThreadedDOMDocument60;
    msKey: uinteger;
Begin
    mb := Params.Metabase;
    msKey := mb.ItemById["MS"].Key;
    model := (mb.ItemByIdNamespace["OBJ_MODEL", msKey]).Bind() As IMsModel;
    cl := New FreeThreadedDOMDocument60.Create();
    node := cl.createElement((model As IMetabaseObjectDescriptor).Id);
    cl.appendChild(node);
    model.Transform.SaveToXml(node);
    System.Diagnostics.Debug.WriteLine(node.xml);
End Sub;

See also:

IMsFormulaTransform