Exporting XML

Meta Data Services Programming

Meta Data Services Programming

Exporting XML

In Microsoft® SQL Server™ 2000 Meta Data Services, exporting Extensible Markup Language (XML) is the process of creating an XML document and populating it with meta data tagged as XML elements. You can export data as an XML file or as a string that is stored in memory. After you export the data, you must import it into a repository database or make it available to another tool.

Exporting is implemented by a dual interface. Automation and COM programmers can use the Export object and IExport interface provided by Meta Data Services.

You can export instance data for specific objects, or recursively through a set of related objects. The XML document is created automatically by the export process. At minimum, you must instantiate the Export object and define the repository objects for which you want to export instance data. The methods you invoke determine whether the XML document is stored in memory or as an XML file that you specify.

You can generate an XML Document Type Definition (DTD) that precisely describes the XML that is produced. You can refer to the XML DTD to find out which XML structures you must support. The XML DTD that you generate is based on an information model. The information model can be a version of the OIM or some other information model that you create. XML DTD generation is provided through the Meta Data Services Software Development Kit (SDK).

Exporting Objects

To export object data, use the Export object and the IExport interface to specify the objects you want. The object can be any repository object. You can specify multiple objects in your application code.

Exporting a Set of Related Objects

You can also export data for related objects within an information model object. The export process will automatically add all target objects recursively as long as you set the COLLECTION_CONTAINING flag for the collection. You must set this flag on the relationship collection in the information model.

To avoid having to manually relate your exported data with the data in the target database, you may need to include the root object as part of your export definition.

See Also

Export Automation Object Example

Importing XML

XML Encoding Errors

XML Encoding Reference

XML IExport Interface Overview

XML IImport Interface Overview