XML IExport Interface Overview

Meta Data Services Programming

Meta Data Services Programming

XML IExport Interface Overview

Using Extensible Markup Language (XML) to export objects from Microsoft® SQL Server™ 2000 Meta Data Services is a two-step process:

  1. Mark objects for export.

  2. Generate the XML file.
Marking Objects for Export

The client marks objects for export by using the IExport::Add method to create an object list. Using this method, the client passes a handle of the repository object to be exported.

The export process creates a collection of all objects that have been added to the export list. The order in which objects are added determines the order in which the objects will appear in the XML document.

After the collection has been created, a client can enumerate through this collection and get information, such as the number of objects, as in a normal collection.

Generating the XML File

The client starts the export by invoking the IExport::Export method. The client passes the name of the file into which the XML document should be exported as a parameter of this method. XML Exporter will overwrite the file if it already exists. The client can specify flags that control the way objects are handled in the output. The allowed flags can be combined using a bitwise logical OR operation. For more information about the effect of each flag, see IExport::Export Method.

IDL Definition

The following expandable text is the part of the Interface Definition Language (IDL) file that describes the methods and the properties on the IExport Interface. In Automation, properties and methods are attached to the IExport object.

IDL Segment

interface IExport : IDispatch
{
   [id(0), helpstring("method Item")] HRESULT Item([in] VARIANT Index, [out,retval] IRepositoryObject **ppRO);
   [id(1), helpstring("method Export")] HRESULT Export([in] BSTR XMLFileName,[in,optional] long Flags);
   [id(2), helpstring("method GetXML")] HRESULT GetXML([in,optional] long Flags,[out,retval] BSTR *XML);
   [id(3), helpstring("method Add")] HRESULT Add([in] IRepositoryObject *pIRO, [in, optional, defaultvalue(0)] long Flags);
   [id(-4), helpstring("method _NewEnum")] HRESULT _NewEnum([out, retval] IUnknown **ppVal);
   [propget, id(6), helpstring("property Count")] HRESULT Count([out, retval] long *pVal);
   [id(7), helpstring("method Remove")] HRESULT Remove([in] VARIANT Index);
   [id(8), helpstring("method Clear")] HRESULT Clear();
};

See Also

XML Import Export