IImport::ImportXML Method
This method is used to import objects from an Extensible Markup Language (XML) document. The document file name and the repository pointer are passed to the method as parameters. The repository this method uses must be opened in the exclusive mode.
COM Syntax
HRESULT ImportXML(
IRepository *pRepository,
BSTR XMLFile,
ITransientObject **pp ITOL
long Flags
);
Parameters
pRepository [in]
A pointer to the IRepository interface.
XMLFile [in]
The XML document file name.
**pp ITOL [out]
A collection of top-level objects to be imported.
Flags [in]
Flag values that control the way XML Importer works.
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 unrecognized tags. |
LOGUNKNOWNTAGS | 16 | If this bit is set, the system creates a file called Msmdcxml.log in the Temp directory. The 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 ImportXML method is attached to the Import object and has the following syntax:
Set TransientCol = object.ImportXML (pRepository, XMLFile [, Flags])