EXI to XML serialization functions.


Typedefs

typedef int(* StartElementHandler )(void *userData, const OSUTF8CHAR *localname, const OSUTF8CHAR *qname, const OSUTF8CHAR *const *attrs)
 SAX start element handler callback function definition.
typedef int(* EndElementHandler )(void *userData, const OSUTF8CHAR *localname, const OSUTF8CHAR *qname)
 SAX end element handler callback function definition.
typedef int(* CharacterDataHandler )(void *userData, const OSUTF8CHAR *value, int len)
 SAX characters handler callback function definition.

Functions

EXTERNEXI EXI2SAXReader * rtEXI2SAXCreateReader (OSCTXT *pctxt, void *pUserData, StartElementHandler startElemFunc, EndElementHandler endElemFunc, CharacterDataHandler charactersFunc)
 This function is used to create a reader structure for use by the main SAX parser function.
EXTERNEXI int rtEXI2SAXParse (EXI2SAXReader *pReader)
 This is the main SAX parser function.
EXTERNEXI int rtExi2XmlStream (OSCTXT *pctxt, OSCTXT *poutctxt)
 This function transcodes an EXI encoded message to an XML output stream.

Typedef Documentation

typedef int(* CharacterDataHandler)(void *userData, const OSUTF8CHAR *value, int len)

SAX characters handler callback function definition.

Parameters:
userData User-defined data structure.
value Character data. String is not null-terminated.
len Number of characters in character string.
Returns:
Status of operation.

Definition at line 76 of file rtEXI2SAX.h.

typedef int(* EndElementHandler)(void *userData, const OSUTF8CHAR *localname, const OSUTF8CHAR *qname)

SAX end element handler callback function definition.

Parameters:
userData User-defined data structure.
localname Local name of element.
qname Qualified name of element.
Returns:
Status of operation.

Definition at line 63 of file rtEXI2SAX.h.

typedef int(* StartElementHandler)(void *userData, const OSUTF8CHAR *localname, const OSUTF8CHAR *qname, const OSUTF8CHAR *const *attrs)

SAX start element handler callback function definition.

Parameters:
userData User-defined data structure.
localname Local name of element.
qname Qualified name of element.
attrs Array of attribute name/value pairs, terminated by 0;
Returns:
Status of operation.

Definition at line 51 of file rtEXI2SAX.h.


Function Documentation

EXTERNEXI EXI2SAXReader* rtEXI2SAXCreateReader ( OSCTXT *  pctxt,
void *  pUserData,
StartElementHandler  startElemFunc,
EndElementHandler  endElemFunc,
CharacterDataHandler  charactersFunc 
)

This function is used to create a reader structure for use by the main SAX parser function.

Parameters:
pctxt Pointer to a context structure.
pUserData Pointer to a user defined data structure that will be passed to the SAX callback functions.
startElemFunc Start element callback function.
endElemFunc End element callback function.
charactersFunc Characters callback function.
Returns:
Initialized SAX reader structure.

EXTERNEXI int rtEXI2SAXParse ( EXI2SAXReader *  pReader  ) 

This is the main SAX parser function.

It converts decoded EXI events to SAX callback function invocations.

Parameters:
pReader Pointer to EXI-to-SAX reader structure.
Returns:
Status of parse operation. Zero if success, negative status code if error.

EXTERNEXI int rtExi2XmlStream ( OSCTXT *  pctxt,
OSCTXT *  poutctxt 
)

This function transcodes an EXI encoded message to an XML output stream.

The input context structure describes an encoded EXI message as either an input stream or in memory in its internal buffer. The output context is assumed to contain an initialized XML output stream set up with one of the rtxStream*CreateWriter functions (for example, rtxStreamFileCreateWriter to write to a file).

Parameters:
pctxt Pointer to input context structure. This is assumed to contain an input stream or memory buffer containing an EXI encoded message.
poutctxt Pointer to an output context assumed to contain an output stream create with an rtxStreamCreateWriter function.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.