XML to EXI serialization functions.


Classes

struct  XML2EXISAXUserData

Functions

EXTERNEXI int rtXmlMem2ExiMem (OSCTXT *pctxt, OSOCTET *outbuf, size_t outbufsiz)
 This function serializes XML data to EXI data and stores the result in the given memory buffer.
EXTERNEXI int rtXmlFile2ExiStream (const char *xmlFileName, OSCTXT *pExiCtxt)
 This function serializes XML data from a file to EXI data and outputs the result to the output stream defined within the given output context.
EXTERNEXI int xml2ExiStartElement (void *userData, const OSUTF8CHAR *localname, const OSUTF8CHAR *qname, const OSUTF8CHAR *const *attrs)
 SAX start element handler callback function.
EXTERNEXI int xml2ExiCharacters (void *userData, const OSUTF8CHAR *chars, int length)
 SAX characters handler callback function definition.
EXTERNEXI int xml2ExiEndElement (void *userData, const OSUTF8CHAR *localname, const OSUTF8CHAR *qname)
 SAX end element handler callback function definition.

Function Documentation

EXTERNEXI int rtXmlFile2ExiStream ( const char *  xmlFileName,
OSCTXT *  pExiCtxt 
)

This function serializes XML data from a file to EXI data and outputs the result to the output stream defined within the given output context.

The input context structure (pctxt) is assumed to contain an encoded XML message in its internal buffer. This will be the case after encoding an XML instance.

Parameters:
xmlFileName Full path to a file containing an XML document.
pExiCtxt Pointer to an output context assumed to contain an output stream descriptor created with an rtxStreamCreateWriter function.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtXmlMem2ExiMem ( OSCTXT *  pctxt,
OSOCTET *  outbuf,
size_t  outbufsiz 
)

This function serializes XML data to EXI data and stores the result in the given memory buffer.

The context structure is assumed to contain an encoded XML message in its internal buffer. This will be the case after encoding an XML instance.

Parameters:
pctxt Pointer to a context structure. This is assumed to hold an encoded XML document or fragment.
outbuf Pointer to output buffer to receive EXI data.
outbufsiz Size of static output buffer.
Returns:
Completion status of operation:
  • positive value indicates success and is encoded message length.
  • negative return value is error.

EXTERNEXI int xml2ExiCharacters ( void *  userData,
const OSUTF8CHAR *  chars,
int  length 
)

SAX characters handler callback function definition.

Parameters:
userData User-defined data structure. In this case, the XML2EXISAXUserData defined above is used.
chars Character data. String is not null-terminated.
length Number of characters in character string.
Returns:
Status of operation.

EXTERNEXI int xml2ExiEndElement ( void *  userData,
const OSUTF8CHAR *  localname,
const OSUTF8CHAR *  qname 
)

SAX end element handler callback function definition.

Parameters:
userData User-defined data structure. In this case, the XML2EXISAXUserData defined above is used.
localname Local name of element.
qname Qualified name of element.
Returns:
Status of operation.

EXTERNEXI int xml2ExiStartElement ( void *  userData,
const OSUTF8CHAR *  localname,
const OSUTF8CHAR *  qname,
const OSUTF8CHAR *const *  attrs 
)

SAX start element handler callback function.

Parameters:
userData User-defined data structure. In this case, the XML2EXISAXUserData defined above is used.
localname Local name of element.
qname Qualified name of element.
attrs Array of attribute name/value pairs, terminated by 0;
Returns:
Status of operation.