...
Code Block | ||||
---|---|---|---|---|
| ||||
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
...
Type | Name | Comment |
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; |
SdaiUnsignedInt | options | A bitwise OR between the options listed and described below. All available options are defined in the header file sdai.h . |
Options: Descriptions:
Return Value
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Options
...
Option | Comment |
---|---|
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 persistant. |
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 abrupted in case of erroneous data. |
...
Example
...
Code Block | ||
---|---|---|
| ||
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 (Content by label) | ||||||
---|---|---|---|---|---|---|
|