Meta Data Services Programming

Importing XML

Importing an XML document is the process of adding meta data to a target repository. You can import meta data that was previously exported through the IExport interface, the Export object, or some other mechanism that you define.

To import object data, you can use the IImport interface and the Import object. You can handle the XML document as a string to import it from memory. More likely, however, you will want to import an XML document from a file.

Import requires the following conditions:

You can set flags on an import object to determine import behavior. For more information, see IImport::ImportXMLString Method and IImport::ImportXML Method.

Import returns a collection of top-level objects that your application can manipulate. To view and manipulate imported data in a repository database, the imported data must be related to the repository root object. When the information model in the target database corresponds to the information model in the source database, a relationship to the root object may be established automatically. However, whether this linkage occurs depends on the structure and content of the imported data. If your imported data is not related to the root object, you must programmatically add an object from the imported data to a collection of the root object. This step is necessary to support navigation and to define relationships with objects in other information models.

See Also

Exporting XML

Import Automation Object Example

Installing Information Models

Using the Model Installer ActiveX Component

XML Encoding Errors

Using XML Encoding

XML Encoding Reference

XML IImport Interface Overview