SaveToXml(Writer: Variant);
Writer. XML element, to which search service parameters are saved.
The SaveToXml method saves search service settings to the specified XML element.
As the Writer parameter, specify the XML element described by the IXmlDomElement interface. The specified element must be created and included to the structure of the XML document, to which settings will be saved.
Add links to the BISearch, Metabase, XML system assemblies.
Sub UserProc;
Var
MB: IMetabase;
SearchFactory: ISearchEngineServiceFactory;
SearchEngine: ISearchEngineServiceBase;
XMLDoc: IXMLDOMDocument3;
XMLElement: IXmlDomElement;
Begin
MB := MetabaseClass.Active;
SearchFactory := New SearchEngineServiceFactory.Create;
SearchEngine := SearchFactory.CreateSearchEngine(MB);
//...
//Determine search platform settings
//...
//Create a new XML document
XMLDoc := New DOMDocument60.Create;
//Create root node
XMLElement := XMLDoc.createElement("Search");
XMLDoc.appendChild(XMLElement);
//Save settings to file
SearchEngine.SaveToXml(XMLElement);
XMLDoc.save("c:\SearchEngine.xml");
End Sub UserProc;
On executing the example an object that gives access to the search service is created. After the setup, these settings will be saved to the SearchEngine.xml file.
See also: