SCA

SDO XML Helper API

SDO XML Helper API
API Usage Examples

Function Index

int sdoSave (DATAOBJECT pdo, char *dest, char *uri, char *name)
 Serializes the supplied dataobject into the dest buffer. More...
 
int fdoXMLSave (SDOXML pxh, SDOXMLDOC pxd, FILE *pf)
 Serializes an XML document to a stream. More...
 
int sdoXMLLoad (SDOXMLDOC doc, char *buffer)
 Loads/creates a dataobject from a buffer containing XML. More...
 
int fdoXMLLoad (SDOXML pxh, SDOXMLDOC pxd, FILE *pf)
 Loads/creates a dataobject from a file stream. More...
 
DATAOBJECT getXMLRootDataObject (SDOXMLDOC pxd)
 Returns the argument XML document as dataobject. More...
 
SDOXMLDOC XMLDocAlloc (SDOXML pxh, DATAOBJECT pdo, char *rootURI, char *rootName)
 Creates an XML document from a dataobject using the specified root element details. More...
 
SDOXML getXMLHelper (SDOFACTORY df)
 Returns a pointer to an XML helper object. More...
 

Function Details

int sdoSave ( DATAOBJECT  pdo,
char *  dest,
char *  uri,
char *  name 
)

Serializes the supplied dataobject into the dest buffer.

Note: the uri and name parameters are ignored and only provided for SDO API compatibility.

Note: don't use this in production code as the callspec for this function doesn't provide for any kind of buffer overflow protection.

int fdoXMLSave ( SDOXML  pxh,
SDOXMLDOC  pxd,
FILE *  pf 
)

Serializes an XML document to a stream.

Parameters
pxhignored
pxdXML document to serialize
pfFILE to write to; must have a resolvable filename which will be used to reopen the file; all content in the resolved filename will be overwritten
Returns
0 if unsuccessfull, non-0 otherwise
int sdoXMLLoad ( SDOXMLDOC  doc,
char *  buffer 
)

Loads/creates a dataobject from a buffer containing XML.

Note the SDO API spec (inconsistently) declares a SDOXML type formal parameter while code examples for sdoXMLLoad() omit/miss actual parameters. Moreover, code examples uses OOP style member function variants for XML helper API calls; these are not implemented.

Returns
0 if unsuccessfull, another value otherwise
int fdoXMLLoad ( SDOXML  pxh,
SDOXMLDOC  pxd,
FILE *  pf 
)

Loads/creates a dataobject from a file stream.

Parameters
pxhignored
pxdXML document to load into
pfFILE to read; must have a resolvable filename which will be used to reopen the FILE
Returns
0 if unsuccessfull, non-0 otherwise
DATAOBJECT getXMLRootDataObject ( SDOXMLDOC  pxd)

Returns the argument XML document as dataobject.

Note this is part of the XML Document API but listed here.

SDOXMLDOC XMLDocAlloc ( SDOXML  pxh,
DATAOBJECT  pdo,
char *  rootURI,
char *  rootName 
)

Creates an XML document from a dataobject using the specified root element details.

Parameters
pxhignored
pdodataobject from which to create XML document; if 0, a fresh, empty dataobject is created for the document
SDOXML getXMLHelper ( SDOFACTORY  df)

Returns a pointer to an XML helper object.

This is a no-op function only provided for SDO API compatibilty. On calling XML helper API functions, the SDOXML parameter value is not needed and ignored.

Returns
0