IImport::ImportXMLString Method

Meta Data Services Programming

Meta Data Services Programming

IImport::ImportXMLString Method

This method is used to import objects from an Extensible Markup Language (XML) document provided as a string. The document file name and the repository pointer are passed to the method as parameters. The repository used by this method must be opened in the exclusive mode.

COM Syntax

HRESULT ImportXML(
      IUnknown *pRepository,
      BSTR XML,
      ITransientObject **pp ITOL
      long Flags
);

Parameters

pRepository [in]

A pointer to the IUnknown interface used as a repository interface pointer.

XML [in]

The XML string to import from.

**pp ITOL [out]

A collection of top-level objects.

Flags [in]

Flag values that control the way XML Importer works. These flags, defined in the following table, are mutually exclusive.

Enumerator Bit Description
NOOVERWRITE 1 If this bit is set, the system generates an error if an object in the file already exists in the target repository.
NEWVERSION 2 If this bit is set, the system automatically creates a new version of any object that already exists.
NOOBJECTCHECK 4 If this bit is set, the system does not check for object existence. If the object exists, an error occurs when the object is created or committed.
IGNOREUNKNOWNTAGS 8 If this bit is set, the system ignores any tags that are not recognized.
LOGUNKNOWNTAGS 16 If this bit is set, the system creates a file called Msmdcxml.log in the Temp directory. This file contains all ignored tags and attributes.
LOGUNMAPPED 32 If this bit is set, the system logs everything that is not mapped during the import from Open Information Model (OIM) 1.0 to the Meta Data Coalition (MDC) OIM.

Return Value

S_OK indicates successful completion.

An error value indicates that the method failed to complete successfully. For more information, see XML Encoding Errors.

Automation Syntax

In Automation, the ImportXMLString method is attached to the Import object and has the following syntax:

   Set Col = object.ImportXMLString (pRepository, XML, [,Flags])

See Also

XML Import Export