edmiReadXMLDocument


 

EdmiError edmiReadXMLDocument (SdaiXml         pXml,
                                SdaiModel       modelId,
                                SdaiString      encodingEdm,
                                SdaiUnsignedInt options);

Reads an Xml formatted document into an existing data model in the EDMdatabase . The imported data will be added to any existing data in the model. In case incremental import is not required, the model must be manually emptied, e.g with edmiDeleteModelContents, before invoking this function.

Arguments


TypeNameComment
SdaiXml

pXml

Xml document exchange struct. See sdai.h for detailed description of all data structure elements.

SdaiModel

modelId

modelId of the data model in the EDMdatabase to populate. This function can not create a model implicitly. I.e, the model must exist.

SdaiString

encodingEdm

The encoding of data in EDM. Valid encodings are;
"UTF-8",
"UTF-16",
"ISO-10646-UCS-2",
"ISO-10646-UCS-4",
"ISO-LATIN-1",
"ISO-LATIN-2",
"ISO-8859-3",
"ISO-8859-4",
"ISO-8859-5",
"ISO-8859-6",
"ISO-8859-7",
"ISO-8859-8",
"ISO-8859-9",
"ISO-2022-jp",
"SHIFT_JIS",
"EUC-JP"
 
Default encoding in EDM is UTF8. If this parameter is NULL or an empty string, the default value will be the encoding that is specified within the Xml document.

SdaiUnsignedInt

options

A bitwise OR between the options listed and described below. All available options are defined in the header file sdai.h .

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

Options


 

OptionComment

SHOW_STATISTICS

Show statistics when reading/writing XML

XML_PARSE_TRACE

Show trace when reading/writing XML

CREATE_SCRATCH_INSTANCES

The imported population in the xml document will not be persistent.

CONTINUE_STORING_ON_ERROR

Ignore errors when populating the data model from the Xml document. E.g, entities that do not exist in the Express schema will simply be ignored. By default, the import will be cancelled in case of erroneous data.

Example


 

 EdmiError rstat;
 SdaiModel modId;
 SdaiXml xml;
 SdaiUnsignedInt options = SHOW_STATISTICS | XML_PARSE_TRACE;
 SdaiString encoding = "UTF-8";
 . . .
  
 modId = edmiGetModel("myRepository", "myModel");
 if (rstat = edmiReadXMLDocument (xml, modId, encoding, options)) {
 printf("\nError %d in edmiReadXMLDocument: %s", rstat, 
 edmiGetErrorText(rstat));
 goto error; 
 }

 

See also

Filter by label

There are no items with the selected labels at this time.

Â