LoadFromXml(Reader: Variant);
LoadFromXml(Reader: Object);
Reader. The XML element from which search service parameters are loaded.
The LoadFromXml method loads parameters of the search service from specified XML element.
As the Reader parameter it is necessary to determine an XML element described by the IXmlDomElement interface. The structure of child elements must be generated using the SaveToXml method.
Executing the example requires a file named SearchEngine.xml in the root directory of the disc C. Parameters of search service should be saved in the file. Connect the BISearch, Metabase, XML system assemblies.
Sub UserProc;
Var
MB: IMetabase;
SearchFactory: ISearchEngineServiceFactory;
SearchEngine: ISearchEngineServiceBase;
XMLDoc: IXMLDOMDocument3;
Begin
MB := MetabaseClass.Active;
SearchFactory := New SearchEngineServiceFactory.Create;
SearchEngine := SearchFactory.CreateSearchEngine(MB);
//Load settings from the XML file
XMLDoc := New DOMDocument60.Create;
XMLDoc.load("c:\SearchEngine.xml");
SearchEngine.LoadFromXml(XMLDoc.documentElement);
//...
//Work with search platform
//...
End Sub UserProc;
On executing the example an object that gives access to the search service is created. Object settings will be loaded from selected file.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.BISearch;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.MsXml2;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
SearchFactory: SearchEngineServiceFactory = New SearchEngineServiceFactoryClass();
SearchEngine: ISearchEngineServiceBase;
XMLDoc: IXMLDOMDocument3;
Begin
MB := Params.Metabase;
SearchEngine := SearchFactory.CreateSearchEngine(MB);
//Load settings from the XML file
XMLDoc := New DOMDocument60();
XMLDoc.load("c:\SearchEngine.xml");
SearchEngine.LoadFromXml(XMLDoc.documentElement);
//...
//Work with search platform
//...
End Sub;
See also: