edmiWriteXMLDocument


 

EdmiError edmiWriteXMLDocument(SdaiModel       modelId,
                                SdaiInstance    *instanceBuffer,
                                SdaiInteger     startIndex,
                                SdaiInteger     maxNumberOfInstances,
                                SdaiInteger     *actualNumberOfInstances,
                                SdaiSelect      pSel,
                                SdaiModel       headerModelId,
                                SdaiInstance    xmlConfigurationId,
                                SdaiString      encodingEdm,
                                SdaiString      encodingOut,
                                SdaiUnsignedInt options,
                                SdaiXml         pXml);

<Description>

Arguments


1TypeNameComment
2SdaiModel

modelId

The instanceId that uniquely identifies the model to export in the EDMdatabase.

3SdaiInstance

*instanceBuffer

A NULL terminated list of instances to export to file in XML format. If set to NULL, the entire model will be exported.

4SdaiInteger

startIndex

The index of the first element in <instanceBuffer> to export to the XML file.

5SdaiInteger

maxNumberOfInstances

The maximum number of instances to export from the <instanceBuffer>.

6SdaiInteger

*actualNumberOfInstances

Receives the actual number of instances exported to the XML file from the <instanceBuffer>.

7SdaiSelect

pSel

An SdaiSelect structure specifying the data export to XML file. This parameter represents an alternative to the <instanceBuffer> way of specifying export data.

8SdaiModel

headerModelId

Header modelId containing values for the iso_10303_28_header element.

9SdaiInstance

xmlConfigurationId

Instance Id of the preferred configuration for the XML. If NULL, the system looks for a configuration with name "default" in the schema. If "default" configuration is not found EDM supplies the following one:
<configuration id="default"
<option
naming-convention="preserve-case"
exp-type="root"
exp-attribute="double-tag"
tagless="true"
inheritance="false"
flatten="false"
sparse="false"/>
</configuration> 

10SdaiString

encodingEdm

The encoding of data in EDM (source). Default is UTF8. Legal values 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"
     
11SdaiString

encodingOut

The desired character encoding for the destination. Default is UTF8

12SdaiUnsignedInt

options

Specifies the options that are enabled in the invocation of the edmiWriteXMLDocument function. The <options> value should be specified as a bitwise OR between the options to enable. All option names are defined in the header file sdai.h .

13SdaiXml

pXml

Document exchange struct with the incoming XML. See sdai.h for detailed description of all data structure elements.

Return Value


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

Options


 

OptionComment

INCLUDE_HEADER

Include header element when writing ISO_10303_28 document

INCLUDE_CONFIGURATION

Include configuration element when writing ISO_10303_28 document

INCLUDE_SCHEMA

Include schema elements when writing ISO_10303_28 document

EXTRACT_SHALLOW

Use this option to prevent referenced instances to be exported. By default EDM will export all the instances given in <psel> or <instanceBuffer> and the entire mesh of referenced instances that spreads out from them.

EDM_IDENTIFIERS

Use the full internal instanceIds of EDM as step Ids in the exported XML file. By default, the step Ids are the local references from within each model.

Example


 

EdmiError rstat;
 EdmiError rstat;
 SdaiModel modId, modHeaderId, dictModId;
 SdaiInteger nHits = 1, index = 1;
 SdaiInstance xmlConfigId, instId;
 SdaiSchema schemaId;
 SdaiAggr aggrId;
 tSdaiSelect sel = { 0, sdaiAGGR, NULL, 0 };
 tEdmXml xml = { "c:/London/Block34.xml", NULL, 0,
 NULL, NULL, 0, 0, NULL, NULL, 0, NULL};
  
 modId = edmiGetModelBN("London", "Block34");
 modHeaderId = edmiGetModelBN("London", "BlockHeader");
 sdaiGetAttrBN(modId, "UNDERLYING_SCHEMA", sdaiINSTANCE, &schemaId);
 dictModId = sdaiGetInstanceModel(schemaId);
 rstat = edmiGetXMLConfigurationId(dictModId, "XMLBlock", &xmlConfigId);
 rstat = edmiFindInstancesBN(modId, "BUILDING", "id=32FC", 1,
 &index, &nHits, &instId); 
 sdaiGetAttrBN(instId, "FLOORS", sdaiAGGR, &aggrId);
 sel.value.aggrVal = aggrId;
 if (rstat = edmiWriteXMLDocument(modId, NULL, 0, 1000, &nHits,
 &sel, modHeaderId, xmlConfigId,
 "UTF-8", "UTF-8",  
 INCLUDE_HEADER | INCLUDE_SCHEMA,
 &xml)) { 
 printf("\nError %d in edmiWriteXMLDocument: %s", rstat, 
 edmiGetErrorText(rstat)); 
 goto Error; 
 }
 . . .

 

See also

Filter by label

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