Home > Support > Documentation

XML encode functions.


Defines

#define rtXmlFinalizeMemBuf(pMemBuf)
#define rtXmlGetEncBufPtr(pctxt)   (pctxt)->buffer.data
 This macro returns the start address of the encoded XML message.
#define rtXmlGetEncBufLen(pctxt)   (pctxt)->buffer.byteIndex
 This macro returns the length of the encoded XML message.

Functions

EXTERNXML int rtXmlEncAny (OSCTXT *pctxt, OSXMLSTRING *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD any type.
EXTERNXML int rtXmlEncAnyStr (OSCTXT *pctxt, const OSUTF8CHAR *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
EXTERNXML int rtXmlEncAnyAttr (OSCTXT *pctxt, OSRTDList *pAnyAttrList)
 This function encodes a list of OSAnyAttr attributes in which the name and value are given as a UTF-8 string.
EXTERNXML int rtXmlEncBase64Binary (OSCTXT *pctxt, OSUINT32 nocts, const OSOCTET *value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD base64Binary type.
EXTERNXML int rtXmlEncBase64BinaryAttr (OSCTXT *pctxt, OSUINT32 nocts, const OSOCTET *value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen)
 This function encodes a variable of the XSD base64Binary type as an attribute.
EXTERNXML int rtXmlEncBase64StrValue (OSCTXT *pctxt, OSUINT32 nocts, const OSOCTET *value)
 This function encodes a variable of the XSD base64Binary type.
EXTERNXML int rtXmlEncBigInt (OSCTXT *pctxt, const OSUTF8CHAR *value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD integer type.
EXTERNXML int rtXmlEncBigIntAttr (OSCTXT *pctxt, const OSUTF8CHAR *value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen)
 This function encodes an XSD integer attribute value.
EXTERNXML int rtXmlEncBigIntValue (OSCTXT *pctxt, const OSUTF8CHAR *value)
 This function encodes an XSD integer attribute value.
EXTERNXML int rtXmlEncBitString (OSCTXT *pctxt, OSUINT32 nbits, const OSOCTET *value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the ASN.1 BIT STRING type.
EXTERNXML int rtXmlEncBinStrValue (OSCTXT *pctxt, OSUINT32 nbits, const OSOCTET *data)
 This function encodes a binary string value as a sequence of '1's and '0's.
EXTERNXML int rtXmlEncBool (OSCTXT *pctxt, OSBOOL value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD boolean type.
EXTERNXML int rtXmlEncBoolValue (OSCTXT *pctxt, OSBOOL value)
 This function encodes a variable of the XSD boolean type.
EXTERNXML int rtXmlEncBoolAttr (OSCTXT *pctxt, OSBOOL value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen)
 This function encodes an XSD boolean attribute value.
EXTERNXML int rtXmlEncDate (OSCTXT *pctxt, const OSXSDDateTime *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD 'date' type as a string.
EXTERNXML int rtXmlEncDateValue (OSCTXT *pctxt, const OSXSDDateTime *pvalue)
 This function encodes a variable of the XSD 'date' type as a string.
EXTERNXML int rtXmlEncTime (OSCTXT *pctxt, const OSXSDDateTime *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD 'time' type as an string.
EXTERNXML int rtXmlEncTimeValue (OSCTXT *pctxt, const OSXSDDateTime *pvalue)
 This function encodes a variable of the XSD 'time' type as an string.
EXTERNXML int rtXmlEncDateTime (OSCTXT *pctxt, const OSXSDDateTime *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a numeric date/time value into an XML string representation.
EXTERNXML int rtXmlEncDateTimeValue (OSCTXT *pctxt, const OSXSDDateTime *pvalue)
 This function encodes a numeric date/time value into an XML string representation.
EXTERNXML int rtXmlEncDecimal (OSCTXT *pctxt, OSREAL value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix, const OSDecimalFmt *pFmtSpec)
 This function encodes a variable of the XSD decimal type.
EXTERNXML int rtXmlEncDecimalAttr (OSCTXT *pctxt, OSREAL value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen, const OSDecimalFmt *pFmtSpec)
 This function encodes a variable of the XSD decimal type as an attribute.
EXTERNXML int rtXmlEncDecimalValue (OSCTXT *pctxt, OSREAL value, const OSDecimalFmt *pFmtSpec, char *pDestBuf, size_t destBufSize)
 This function encodes a value of the XSD decimal type.
EXTERNXML int rtXmlEncDouble (OSCTXT *pctxt, OSREAL value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix, const OSDoubleFmt *pFmtSpec)
 This function encodes a variable of the XSD double type.
EXTERNXML int rtXmlEncDoubleAttr (OSCTXT *pctxt, OSREAL value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen, const OSDoubleFmt *pFmtSpec)
 This function encodes a variable of the XSD double type as an attribute.
EXTERNXML int rtXmlEncDoubleValue (OSCTXT *pctxt, OSREAL value, const OSDoubleFmt *pFmtSpec, int defaultPrecision)
 This function encodes a value of the XSD double or float type.
EXTERNXML int rtXmlEncEmptyElement (OSCTXT *pctxt, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix, OSBOOL terminate)
 This function encodes an enpty element tag value (<elemName>).
EXTERNXML int rtXmlEncEmptyElement2 (OSCTXT *pctxt, const OSUTF8CHAR *elemName, size_t elemLen, const OSUTF8CHAR *nsPrefix, size_t nsPrefixLen, OSBOOL terminate)
EXTERNXML int rtXmlEncEndDocument (OSCTXT *pctxt)
 This function adds trailor information and a null terminator at the end of the XML document being encoded.
EXTERNXML int rtXmlEncEndElement (OSCTXT *pctxt, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes an end element tag value (</elemName>).
EXTERNXML int rtXmlEncEndElement2 (OSCTXT *pctxt, const OSUTF8CHAR *elemName, size_t elemLen, const OSUTF8CHAR *nsPrefix, size_t nsPrefixLen)
EXTERNXML int rtXmlEncEndSoapEnv (OSCTXT *pctxt)
 This function encodes a SOAP envelope end element tag (<SOAP-ENV:Envelope/>).
EXTERNXML int rtXmlEncFloat (OSCTXT *pctxt, OSREAL value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix, const OSDoubleFmt *pFmtSpec)
 This function encodes a variable of the XSD float type.
EXTERNXML int rtXmlEncFloatAttr (OSCTXT *pctxt, OSREAL value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen, const OSDoubleFmt *pFmtSpec)
 This function encodes a variable of the XSD float type as an attribute.
EXTERNXML int rtXmlEncGYear (OSCTXT *pctxt, const OSXSDDateTime *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a numeric gYear element into an XML string representation.
EXTERNXML int rtXmlEncGYearMonth (OSCTXT *pctxt, const OSXSDDateTime *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a numeric gYearMonth element into an XML string representation.
EXTERNXML int rtXmlEncGMonth (OSCTXT *pctxt, const OSXSDDateTime *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a numeric gMonth element into an XML string representation.
EXTERNXML int rtXmlEncGMonthDay (OSCTXT *pctxt, const OSXSDDateTime *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a numeric gMonthDay element into an XML string representation.
EXTERNXML int rtXmlEncGDay (OSCTXT *pctxt, const OSXSDDateTime *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a numeric gDay element into an XML string representation.
EXTERNXML int rtXmlEncGYearValue (OSCTXT *pctxt, const OSXSDDateTime *pvalue)
 This function encodes a numeric gYear value into an XML string representation.
EXTERNXML int rtXmlEncGYearMonthValue (OSCTXT *pctxt, const OSXSDDateTime *pvalue)
 This function encodes a numeric gYearMonth value into an XML string representation.
EXTERNXML int rtXmlEncGMonthValue (OSCTXT *pctxt, const OSXSDDateTime *pvalue)
 This function encodes a numeric gMonth value into an XML string representation.
EXTERNXML int rtXmlEncGMonthDayValue (OSCTXT *pctxt, const OSXSDDateTime *pvalue)
 This function encodes a numeric gMonthDay value into an XML string representation.
EXTERNXML int rtXmlEncGDayValue (OSCTXT *pctxt, const OSXSDDateTime *pvalue)
 This function encodes a numeric gDay value into an XML string representation.
EXTERNXML int rtXmlEncHexBinary (OSCTXT *pctxt, OSUINT32 nocts, const OSOCTET *value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD hexBinary type.
EXTERNXML int rtXmlEncHexBinaryAttr (OSCTXT *pctxt, OSUINT32 nocts, const OSOCTET *value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen)
 This function encodes a variable of the XSD hexBinary type as an attribute.
EXTERNXML int rtXmlEncHexStrValue (OSCTXT *pctxt, OSUINT32 nocts, const OSOCTET *data)
 This function encodes a variable of the XSD hexBinary type.
EXTERNXML int rtXmlEncIndent (OSCTXT *pctxt)
 This function adds indentation whitespace to the output stream.
EXTERNXML int rtXmlEncInt (OSCTXT *pctxt, OSINT32 value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD integer type.
EXTERNXML int rtXmlEncIntValue (OSCTXT *pctxt, OSINT32 value)
 This function encodes a variable of the XSD integer type.
EXTERNXML int rtXmlEncIntAttr (OSCTXT *pctxt, OSINT32 value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen)
 This function encodes a variable of the XSD integer type as an attribute (name="value").
EXTERNXML int rtXmlEncIntPattern (OSCTXT *pctxt, OSINT32 value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix, const OSUTF8CHAR *pattern)
 This function encodes a variable of the XSD integer type using a pattern to specify the format of the integer value.
EXTERNXML int rtXmlEncIntPatternValue (OSCTXT *pctxt, OSINT32 value, const OSUTF8CHAR *pattern)
EXTERNXML int rtXmlEncInt64 (OSCTXT *pctxt, OSINT64 value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD integer type.
EXTERNXML int rtXmlEncInt64Value (OSCTXT *pctxt, OSINT64 value)
 This function encodes a variable of the XSD integer type.
EXTERNXML int rtXmlEncInt64Attr (OSCTXT *pctxt, OSINT64 value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen)
 This function encodes a variable of the XSD integer type as an attribute (name="value").
EXTERNXML int rtXmlEncNamedBits (OSCTXT *pctxt, const OSBitMapItem *pBitMap, OSUINT32 nbits, const OSOCTET *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the ASN.1 BIT STRING type.
EXTERNXML int rtXmlEncNamedBitsValue (OSCTXT *pctxt, const OSBitMapItem *pBitMap, OSUINT32 nbits, const OSOCTET *pvalue)
EXTERNXML int rtXmlEncNSAttrs (OSCTXT *pctxt)
 This function encodes namespace declaration attributes at the beginning of an XML document.
EXTERNXML int rtXmlEncReal10 (OSCTXT *pctxt, const OSUTF8CHAR *pvalue, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the ASN.1 REAL base 10 type.
EXTERNXML int rtXmlEncSoapArrayTypeAttr (OSCTXT *pctxt, const OSUTF8CHAR *name, const OSUTF8CHAR *value, size_t itemCount)
 This function encodes the special SOAP encoding attrType attribute which specifies the number and type of elements in a SOAP array.
EXTERNXML int rtXmlEncSoapArrayTypeAttr2 (OSCTXT *pctxt, const OSUTF8CHAR *name, size_t nameLen, const OSUTF8CHAR *value, size_t valueLen, size_t itemCount)
EXTERNXML int rtXmlEncStartDocument (OSCTXT *pctxt)
 This function encodes the XML header text at the beginning of an XML document.
EXTERNXML int rtXmlEncStartElement (OSCTXT *pctxt, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix, OSBOOL terminate)
 This function encodes a start element tag value (<elemName>).
EXTERNXML int rtXmlEncStartElement2 (OSCTXT *pctxt, const OSUTF8CHAR *elemName, size_t elemLen, const OSUTF8CHAR *nsPrefix, size_t nsPrefixLen, OSBOOL terminate)
 This function encodes a start element tag value (<elemName>).
EXTERNXML int rtXmlEncStartSoapEnv (OSCTXT *pctxt)
 This function encodes a SOAP envelope start element tag.
EXTERNXML int rtXmlEncString (OSCTXT *pctxt, OSXMLSTRING *pxmlstr, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD string type.
EXTERNXML int rtXmlEncStringValue (OSCTXT *pctxt, const OSUTF8CHAR *value)
 This function encodes a variable of the XSD string type.
EXTERNXML int rtXmlEncStringValue2 (OSCTXT *pctxt, const OSUTF8CHAR *value, size_t valueLen)
 This function encodes a variable of the XSD string type.
EXTERNXML int rtXmlEncUnicodeStr (OSCTXT *pctxt, const OSUNICHAR *value, OSUINT32 nchars, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a Unicode string value.
EXTERNXML int rtXmlEncUTF8Attr (OSCTXT *pctxt, const OSUTF8CHAR *name, const OSUTF8CHAR *value)
 This function encodes an attribute in which the name and value are given as a null-terminated UTF-8 strings.
EXTERNXML int rtXmlEncUTF8Attr2 (OSCTXT *pctxt, const OSUTF8CHAR *name, size_t nameLen, const OSUTF8CHAR *value, size_t valueLen)
 This function encodes an attribute in which the name and value are given as a UTF-8 strings with lengths.
EXTERNXML int rtXmlEncUTF8Str (OSCTXT *pctxt, const OSUTF8CHAR *value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a UTF-8 string value.
EXTERNXML int rtXmlEncUInt (OSCTXT *pctxt, OSUINT32 value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD unsigned integer type.
EXTERNXML int rtXmlEncUIntValue (OSCTXT *pctxt, OSUINT32 value)
 This function encodes a variable of the XSD unsigned integer type.
EXTERNXML int rtXmlEncUIntAttr (OSCTXT *pctxt, OSUINT32 value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen)
 This function encodes a variable of the XSD unsigned integer type as an attribute (name="value").
EXTERNXML int rtXmlEncUInt64 (OSCTXT *pctxt, OSUINT64 value, const OSUTF8CHAR *elemName, const OSUTF8CHAR *nsPrefix)
 This function encodes a variable of the XSD integer type.
EXTERNXML int rtXmlEncUInt64Value (OSCTXT *pctxt, OSUINT64 value)
 This function encodes a variable of the XSD integer type.
EXTERNXML int rtXmlEncUInt64Attr (OSCTXT *pctxt, OSUINT64 value, const OSUTF8CHAR *attrName, OSUINT16 attrNameLen)
 This function encodes a variable of the XSD integer type as an attribute (name="value").
EXTERNXML int rtXmlEncXSIAttrs (OSCTXT *pctxt, OSBOOL needXSI)
 This function encodes XML schema instance (XSI) attributes at the beginning of an XML document.
EXTERNXML int rtXmlFreeInputSource (OSCTXT *pctxt)
 This function closes an input source that was previously created with one of the create input source functions such as 'rtXmlCreateFileInputSource'.
EXTERNXML OSBOOL rtXmlStrCmpAsc (const OSUTF8CHAR *text1, const char *text2)
EXTERNXML OSBOOL rtXmlStrnCmpAsc (const OSUTF8CHAR *text1, const char *text2, size_t len)
EXTERNXML int rtXmlSetEncBufPtr (OSCTXT *pctxt, OSOCTET *bufaddr, size_t bufsiz)
 This function is used to set the internal buffer within the run-time library encoding context.
EXTERNXML int rtXmlGetIndent (OSCTXT *pctxt)
 This function returns current XML output indent value.
EXTERNXML int rtXmlGetIndentChar (OSCTXT *pctxt)
 This function returns current XML output indent character value (default is space).

Define Documentation

#define rtXmlFinalizeMemBuf pMemBuf   ) 
 

Value:

do { \
(pMemBuf)->pctxt->buffer.data = (pMemBuf)->buffer + (pMemBuf)->startidx; \
(pMemBuf)->pctxt->buffer.size =                                      \
((pMemBuf)->usedcnt - (pMemBuf)->startidx);                          \
(pMemBuf)->pctxt->buffer.dynamic = FALSE;                            \
(pMemBuf)->pctxt->buffer.byteIndex = 0;                              \
rtxMemBufReset (pMemBuf);                                            \
} while(0)

Definition at line 2166 of file osrtxml.h.

#define rtXmlGetEncBufLen pctxt   )     (pctxt)->buffer.byteIndex
 

This macro returns the length of the encoded XML message.

Parameters:
pctxt Pointer to a context structure.

Definition at line 2215 of file osrtxml.h.

#define rtXmlGetEncBufPtr pctxt   )     (pctxt)->buffer.data
 

This macro returns the start address of the encoded XML message.

If a static buffer was used, this is simply the start address of the buffer. If dynamic encoding was done, this will return the start address of the dynamic buffer allocated by the encoder.

Parameters:
pctxt Pointer to a context structure.

Definition at line 2208 of file osrtxml.h.


Function Documentation

EXTERNXML int rtXmlEncAny OSCTXT *  pctxt,
OSXMLSTRING *  pvalue,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix
 

This function encodes a variable of the XSD any type.

This is considered to be a fully-wrapped element of any type (for example: <myType>myData</myType>)

Parameters:
pctxt Pointer to context block structure.
pvalue Value to be encoded. This is a string containing the fully-encoded XML text to be copied to the output stream.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncAnyAttr OSCTXT *  pctxt,
OSRTDList *  pAnyAttrList
 

This function encodes a list of OSAnyAttr attributes in which the name and value are given as a UTF-8 string.

Parameters:
pctxt Pointer to context block structure.
pAnyAttrList List of attributes.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBase64Binary OSCTXT *  pctxt,
OSUINT32  nocts,
const OSOCTET *  value,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix
 

This function encodes a variable of the XSD base64Binary type.

Parameters:
pctxt Pointer to context block structure.
nocts Number of octets in the value string.
value Value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBase64BinaryAttr OSCTXT *  pctxt,
OSUINT32  nocts,
const OSOCTET *  value,
const OSUTF8CHAR *  attrName,
OSUINT16  attrNameLen
 

This function encodes a variable of the XSD base64Binary type as an attribute.

Parameters:
pctxt Pointer to context block structure.
nocts Number of octets in the value string.
value Value to be encoded.
attrName XML attribute name. A name must be provided.
attrNameLen Length in bytes of the attribute name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBase64StrValue OSCTXT *  pctxt,
OSUINT32  nocts,
const OSOCTET *  value
 

This function encodes a variable of the XSD base64Binary type.

It just puts the encoded value in the destination buffer or stream without any tags.

Parameters:
pctxt Pointer to context block structure.
nocts Number of octets in the value string.
value Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBigInt OSCTXT *  pctxt,
const OSUTF8CHAR *  value,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix
 

This function encodes a variable of the XSD integer type.

In this case, the integer is assumed to be of a larger size than can fit in a C or C++ long type (normally 32 or 64 bits). For example, parameters used to calculate security values are typically larger than these sizes.

Items of this type are stored in character string constant variables. They can be represented as decimal strings (with no prefixes), as hexadecimal strings starting with a "0x" prefix, as octal strings starting with a "0o" prefix or as binary strings starting with a "0b" prefix. Other radixes are currently not supported.

Parameters:
pctxt Pointer to context block structure.
value A pointer to a character string containing the value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBigIntAttr OSCTXT *  pctxt,
const OSUTF8CHAR *  value,
const OSUTF8CHAR *  attrName,
OSUINT16  attrNameLen
 

This function encodes an XSD integer attribute value.

In this case, the integer is assumed to be of a larger size than can fit in a C or C++ long type (normally 32 or 64 bits).

Parameters:
pctxt Pointer to context block structure.
value A pointer to a character string containing the value to be encoded.
attrName XML attribute name. A name must be provided.
attrNameLen Length in bytes of the attribute name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBigIntValue OSCTXT *  pctxt,
const OSUTF8CHAR *  value
 

This function encodes an XSD integer attribute value.

In this case, the integer is assumed to be of a larger size than can fit in a C or C++ long type (normally 32 or 64 bits). This function just puts the encoded value in the destination buffer or stream without any tags.

Parameters:
pctxt Pointer to context block structure.
value A pointer to a character string containing the value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBinStrValue OSCTXT *  pctxt,
OSUINT32  nbits,
const OSOCTET *  data
 

This function encodes a binary string value as a sequence of '1's and '0's.

Parameters:
pctxt Pointer to context block structure.
nbits Number of bits in the value string.
data Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBitString OSCTXT *  pctxt,
OSUINT32  nbits,
const OSOCTET *  value,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix
 

This function encodes a variable of the ASN.1 BIT STRING type.

The encoded data is a sequence of '1's and '0's. This is only used if named bits are not specified in the string (

See also:
rtXmlEncNamedBits).
Parameters:
pctxt Pointer to context block structure.
nbits Number of bits in the bit string.
value Value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBool OSCTXT *  pctxt,
OSBOOL  value,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix
 

This function encodes a variable of the XSD boolean type.

Parameters:
pctxt Pointer to context block structure.
value Boolean value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBoolAttr OSCTXT *  pctxt,
OSBOOL  value,
const OSUTF8CHAR *  attrName,
OSUINT16  attrNameLen
 

This function encodes an XSD boolean attribute value.

Parameters:
pctxt Pointer to context block structure.
value Boolean value to be encoded.
attrName XML attribute name. A name must be provided.
attrNameLen Length in bytes of the attribute name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncBoolValue OSCTXT *  pctxt,
OSBOOL  value
 

This function encodes a variable of the XSD boolean type.

It just puts the encoded value in the destination buffer or stream without any tags.

Parameters:
pctxt Pointer to context block structure.
value Boolean value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDate OSCTXT *  pctxt,
const OSXSDDateTime *  pvalue,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix
 

This function encodes a variable of the XSD 'date' type as a string.

This version of the function is used to encode an OSXSDDateTime value into CCYY-MM-DD format.

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDateTime OSCTXT *  pctxt,
const OSXSDDateTime *  pvalue,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix
 

This function encodes a numeric date/time value into an XML string representation.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDateTimeValue OSCTXT *  pctxt,
const OSXSDDateTime *  pvalue
 

This function encodes a numeric date/time value into an XML string representation.

It just puts the encoded value in the destination buffer or stream without any tags.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDateValue OSCTXT *  pctxt,
const OSXSDDateTime *  pvalue
 

This function encodes a variable of the XSD 'date' type as a string.

This version of the function is used to encode an OSXSDDateTime value into CCYY-MM-DD format. This function just puts the encoded value in the destination buffer or stream without any tags.

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDecimal OSCTXT *  pctxt,
OSREAL  value,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix,
const OSDecimalFmt pFmtSpec
 

This function encodes a variable of the XSD decimal type.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
pFmtSpec Pointer to format specification structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDecimalAttr OSCTXT *  pctxt,
OSREAL  value,
const OSUTF8CHAR *  attrName,
OSUINT16  attrNameLen,
const OSDecimalFmt pFmtSpec
 

This function encodes a variable of the XSD decimal type as an attribute.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
attrName XML attribute name. A name must be provided.
attrNameLen Length of XML attribute name.
pFmtSpec Pointer to format specification structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDecimalValue OSCTXT *  pctxt,
OSREAL  value,
const OSDecimalFmt pFmtSpec,
char *  pDestBuf,
size_t  destBufSize
 

This function encodes a value of the XSD decimal type.

It just puts the encoded value in the destination buffer or stream without any tags.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
pFmtSpec Pointer to format specification structure.
pDestBuf Pointer to a destination buffer. If NULL (destBufSize should be 0) the encoded value will be put in pctxt->buffer or in stream associated with the pctxt.
destBufSize The size of the destination buffer. Must be 0, if pDestBuf is NULL.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDouble OSCTXT *  pctxt,
OSREAL  value,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix,
const OSDoubleFmt pFmtSpec
 

This function encodes a variable of the XSD double type.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
pFmtSpec Pointer to format specification structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDoubleAttr OSCTXT *  pctxt,
OSREAL  value,
const OSUTF8CHAR *  attrName,
OSUINT16  attrNameLen,
const OSDoubleFmt pFmtSpec
 

This function encodes a variable of the XSD double type as an attribute.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
attrName XML attribute name. A name must be provided.
attrNameLen Length of XML attribute name.
pFmtSpec Pointer to format specification structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncDoubleValue OSCTXT *  pctxt,
OSREAL  value,
const OSDoubleFmt pFmtSpec,
int  defaultPrecision
 

This function encodes a value of the XSD double or float type.

It just puts the encoded value in the destination buffer or stream without any tags.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
pFmtSpec Pointer to format specification structure.
defaultPrecision Default precision of the value. For float, it is 6, for double it is 15.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncEmptyElement OSCTXT *  pctxt,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix,
OSBOOL  terminate
 

This function encodes an enpty element tag value (<elemName>).

Parameters:
pctxt Pointer to context block structure.
elemName XML element name.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
terminate Add closing '>' character.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncEndDocument OSCTXT *  pctxt  ) 
 

This function adds trailor information and a null terminator at the end of the XML document being encoded.

Parameters:
pctxt Pointer to context block structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncEndElement OSCTXT *  pctxt,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix
 

This function encodes an end element tag value (</elemName>).

Parameters:
pctxt Pointer to context block structure.
elemName XML element name.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncEndSoapEnv OSCTXT *  pctxt  ) 
 

This function encodes a SOAP envelope end element tag (<SOAP-ENV:Envelope/>).

Parameters:
pctxt Pointer to context block structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncFloat OSCTXT *  pctxt,
OSREAL  value,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix,
const OSDoubleFmt pFmtSpec
 

This function encodes a variable of the XSD float type.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
pFmtSpec Pointer to format specification structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncFloatAttr OSCTXT *  pctxt,
OSREAL  value,
const OSUTF8CHAR *  attrName,
OSUINT16  attrNameLen,
const OSDoubleFmt pFmtSpec
 

This function encodes a variable of the XSD float type as an attribute.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
attrName XML attribute name. A name must be provided.
attrNameLen Length of XML attribute name.
pFmtSpec Pointer to format specification structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNXML int rtXmlEncGDay OSCTXT *  pctxt,
const OSXSDDateTime *  pvalue,
const OSUTF8CHAR *  elemName,
const OSUTF8CHAR *  nsPrefix
 

This function encodes a numeric gDay element into an XML string representation.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to value to be encoded.
elemName XML element name. A name must be provided. If an empty string is passed (""), no element tag is added to the encoded value.
nsPrefix XML namespace prefix. If not null, will be prepended to elemName to form a qualified name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.