Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »


 
Reads the XML Configuration data assosiated by a given XML Configuration Name.
 
Related functions: edmiCreateXMLConfiguration, edmiDeleteXMLConfiguration, edmiDeleteXMLConfigurationBN, edmiGetXMLConfiguration, edmiGetXMLConfigurationId, edmiListXMLConfigurations
Header:
#include "sdai.h"
Prototype:
EdmiError edmiGetXMLConfigurationBN(SdaiSchema    schemaId,
                                     SdaiString    xmlConfigurationName,
                                     SdaiInstance  *xmlConfigurationId,
                                     SdaiString    *xmlConfigurationString,
                                     SdaiString    *nameSpace, 
                                     SdaiString    *nameSpaceAlias, 
                                     SdaiString    *xmlSchemaURL);
Arguments:

schemaId

The schemaID that uniquely identifies the edmSchema for which the XML Configuration was created.

xmlConfigurationName

The name of the XML Configuration.

xmlConfigurationId

The instance Id that uniquely identifies the XML Configuration in the EDMdatabase

xmlConfigurationString

An SdaiString pointer that will receive the address of an allocated string buffer containing the XML Configuration data. Use edmiFree to release this memory.

nameSpace

An SdaiString pointer that will receive the address of a string buffer containing the namespace of the elements contained in the UOS element of the generated XML. Use edmiFree to release this memory.

nameSpaceAlias

An SdaiString pointer that will receive the address of an allocated string buffer containing the alias of the <nameSpace> above. Use edmiFree to release this memory.

xmlSchemaURL

An SdaiString pointer that will receive the address of an allocated string buffer containing the XML Schema URL assosiated with the <nameSpace> above.

Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
SdaiInstance schemaId;
EdmiError rstat;
SdaiModel modId;
SdaiModel dictModId;
SdaiSchema schemaId;
SdaiInstance xmlConfigId;
SdaiString xmlConfigString;
SdaiString nameSpace;
SdaiString nameSpaceAlias;
SdaiString xmlSchemaURL;
. . .
modId = edmiGetModelBN("London", "Block34");
sdaiGetAttrBN(modId, "UNDERLYING_SCHEMA", sdaiINSTANCE, &schemaId);
dictModId = sdaiGetInstanceModel(schemaId);
if (rstat = edmiGetXMLConfigurationBN(dictModId, "myXmlConfig",
&xmlConfigId, &xmlConfigString,
&nameSpace, &nameSpaceAlias,
&xmlSchemaURL)) { 
printf("\nError %d in edmiGetXMLConfigurationBN: %s", rstat,
edmiGetErrorText(rstat)); 
goto Error; 
}
 
/* Print Configuration data */
printf("\nXml Configuration Id: %d", xmlConfigId);
printf("\nName Space: %s", nameSpace);
printf("\nName Space Alias: %s", nameSpaceAlias);
printf("\nSchema URL: %s", xmlSchemaURL);
printf("\nConfiguration String: |%s|", xmlConfigString);
 
/* Free allocated memory */
edmiFree(xmlConfigString);
edmiFree(nameSpace);
edmiFree(nameSpaceAlias);
edmiFree(xmlSchemaURL);
. . .

  • No labels