Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

osrtxml.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2006 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00028 #ifndef _OSRTXML_H_
00029 #define _OSRTXML_H_
00030 
00031 #ifdef BUILDXMLDLL
00032 #define EXTERNXML __declspec(dllexport)
00033 #elif defined (USEXMLDLL)
00034 #define EXTERNXML __declspec(dllimport)
00035 #else
00036 #define EXTERNXML
00037 #endif /* BUILDXMLDLL */
00038 
00039 #include "rtxsrc/rtxCommon.h"
00040 #include "rtxmlsrc/rtSaxDefs.h"
00041 #include "rtxsrc/rtxDList.h"
00042 #include "rtxsrc/rtxMemBuf.h"
00043 #include "rtxsrc/rtxFloat.h"
00044 
00045 #ifdef __cplusplus
00046 class OSRTObjListClass;
00047 #include "rtxsrc/rtxCppMemBuf.h"
00048 #endif
00049 
00050 #define OSXMLSOAP11URI "http://schemas.xmlsoap.org/soap/envelope/"
00051 #define OSXMLSOAP12URI "http://www.w3.org/2003/05/soap-envelope"
00052 
00053 typedef enum { 
00054    OSXMLUTF8, 
00055    OSXMLUTF16
00056 } OSXMLEncoding;
00057 
00058 typedef struct OSXMLFacets {
00059    int totalDigits;
00060    int fractionDigits;
00061 } OSXMLFacets;
00062 
00063 /*
00064  * NOTE: If a field is added to this structure, make sure to add code to 
00065  * to rtXmlInitCtxtAppInfo in rtXmlContext.c to initialize it.
00066  */
00067 typedef struct {
00068    OSFreeCtxtAppInfoPtr  pFreeFunc; /* Free function pointer            */
00069    OSResetCtxtAppInfoPtr pResetFunc;/* Reset function pointer           */
00070    OSUTF8CHAR* schemaLocation;  /* xsi:schemaLocation attribute         */
00071    OSUTF8CHAR* noNSSchemaLoc;   /* xsi:noNamespaceSchemaLocation attr   */
00072    OSUTF8CHAR* xsiTypeAttr;     /* xsi:type attribute value             */
00073    OSXMLEncoding encoding;      /* XML document encoding (ex. UTF-8)    */
00074    OSRTDList namespaceList;     /* list of OSXMLNamespace               */
00075    OSMemBuf  memBuf;            /* memory buffer for character method   */
00076    OSINT32 mSaxLevel;
00077    OSINT32 mSkipLevel;
00078    OSUINT32 maxSaxErrors;       /* maximum number of errors             */
00079    OSUINT32 errorsCnt;          /* counter of errors                    */
00080    OSXMLFacets facets;
00081    const OSUTF8CHAR* encodingStr;/* name of encoding ("UTF-8", "ISO-...")*/
00082    OSUINT8 indent;              /* XML output indent                    */
00083    OSBOOL mbCdataProcessed;     /* CDATA section was processed          */
00084    OSBOOL encDocHeader;         /* encode XML document header           */
00085    char indentChar;             /* indent char, default is space (' ')  */
00086 } OSXMLCtxtInfo;
00087 
00088 typedef enum { 
00089    OSXMLINIT, 
00090    OSXMLHEADER, 
00091    OSXMLSTART, 
00092    OSXMLDATA, 
00093    OSXMLEND
00094 } OSXMLState;
00095 
00096 typedef struct OSXMLQName {
00097    const OSUTF8CHAR* nsPrefix;
00098    const OSUTF8CHAR* ncName;
00099 } OSXMLQName;
00100 
00101 struct OSSAXHandlerBase;
00102 
00103 typedef struct OSIntegerFmt {
00104    OSINT8 integerMaxDigits;   /* Maximum digits in integer part; 
00105                                  leading zeros will be added, if necessary. */
00106    OSBOOL signPresent;        /* Indicates, sign must present, even if value 
00107                                  is positive. */
00108 } OSIntegerFmt;
00109 
00110 typedef struct OSDecimalFmt {
00111    OSINT8 totalDigits;        /* total significiant digits */
00112    OSINT8 fractionDigits;     /* maximum signficiant digits in fraction, 
00113                                  precision */
00114    OSINT8 fractionMinDigits;  /* minimum digits in fraction, if 
00115                                  fraction digits less than this value 
00116                                  trailing zeros will be added. */
00117    OSINT8 integerMaxDigits;   /* Maximum digits in integer part; if it is 0 
00118                                  and integer part is 0 then integer part 
00119                                  will be omitted, like .3, or -.3 */
00120    OSINT8 integerMinDigits;   /* Minimum digits in integer part, leading zeros
00121                                  will be added if necessary. */
00122    OSBOOL signPresent;        /* Indicates, sign must present, even if value 
00123                                  is positive. */
00124    OSBOOL pointPresent;       /* Indicates, decimal point must present, even 
00125                                  if value's fraction is 0 */
00126    OSUINT8 nPatterns;         /* number of patterns stored in 'patterns' */
00127    const char* const* patterns; /* patterns, used to verify value format is 
00128                                  correct */
00129 } OSDecimalFmt;
00130 
00131 typedef struct OSDoubleFmt {
00132    OSINT8 totalDigits;        /* total significiant digits */
00133    OSINT8 fractionDigits;     /* maximum signficiant digits in fraction, 
00134                                  precision */
00135    OSINT8 fractionMinDigits;  /* minimum digits in fraction, if 
00136                                  fraction digits less than this value 
00137                                  trailing zeros will be added. */
00138    OSINT8 integerMaxDigits;   /* Maximum digits in integer part; if it is 0 
00139                                  and integer part is 0 then integer part 
00140                                  will be omitted, like .3, or -.3 */
00141    OSINT8 integerMinDigits;   /* Minimum digits in integer part, leading zeros
00142                                  will be added if necessary. */
00143    OSINT8 expSymbol;          /* 'E' or 'e' only; 0 if no exp is expected, 
00144                                  -1 - default ('E') */
00145    OSINT16 expMinValue;       /* Minimum exponent value. By default - -infinity */
00146    OSINT16 expMaxValue;       /* Maximum exponent value. By default - infinity */
00147    OSINT8 expDigits;          /* Total digits in exponent part; if exponent's
00148                                  value is not enough, trailing zeros will be
00149                                  added */
00150    OSBOOL signPresent;        /* Indicates, sign must present, even if value 
00151                                  is positive. */
00152    OSBOOL pointPresent;       /* Indicates, decimal point must present, even 
00153                                  if value's fraction is 0 */
00154    OSBOOL expPresent;         /* Indicates, exponent must present, even 
00155                                  if its value is 0 */
00156    OSBOOL expSignPresent;     /* Indicates, exponent sign must present, even 
00157                                  if its value is > 0 */
00158 } OSDoubleFmt;
00159 
00160 #define OSXMLINDENT     3
00161 
00162 #ifdef XML_UNICODE
00163 #define rtXmlErrAddStrParm rtxErrAddUniStrParm
00164 #else
00165 #define rtXmlErrAddStrParm rtxErrAddStrParm
00166 #endif
00167 
00168 #ifdef __cplusplus
00169 extern "C" {
00170 #endif
00171 
00172 /* run-time XML function prototypes */
00173 
00180 EXTERNXML int rtXmlInitContext (OSCTXT* pctxt);
00181 
00192 EXTERNXML int rtXmlCreateFileInputSource (OSCTXT* pctxt, const char* filepath);
00193 
00194 EXTERNXML OSBOOL rtXmlCmpQName 
00195 (const OSUTF8CHAR* qname1, const OSUTF8CHAR* name2, const OSUTF8CHAR* nsPrefix2);
00196 
00197 EXTERNXML int rtXmlGetBase64StrDecodedLen 
00198    (const OSUTF8CHAR* inpdata, size_t srcDataSize, 
00199     size_t* pNumOcts, size_t* pSrcDataLen);
00200 
00221 EXTERNXML int rtXmlDecBase64Binary (OSMemBuf* pMemBuf, 
00222                                     const OSUTF8CHAR* inpdata, 
00223                                     int length);
00224 
00248 EXTERNXML int rtXmlDecBase64Str (OSCTXT* pctxt, 
00249                                  OSOCTET* pvalue, OSUINT16* pnocts, 
00250                                  OSINT32 bufsize);
00251 
00277 EXTERNXML int rtXmlDecBase64StrValue (OSCTXT* pctxt, 
00278                                       OSOCTET* pvalue, OSUINT32* pnocts, 
00279                                       size_t bufSize, size_t srcDataLen);
00280 
00302 EXTERNXML int rtXmlDecBigInt 
00303 (OSCTXT* pctxt, const OSUTF8CHAR** ppvalue);
00304 
00315 EXTERNXML int rtXmlDecBool (OSCTXT* pctxt, OSBOOL* pvalue);
00316 
00329 EXTERNXML int rtXmlDecDate (OSCTXT* pctxt, OSXSDDateTime* pvalue);
00330 
00349 EXTERNXML int rtXmlDecTime (OSCTXT* pctxt, OSXSDDateTime* pvalue);
00350 
00363 EXTERNXML int rtXmlDecDateTime (OSCTXT* pctxt, OSXSDDateTime* pvalue);
00364 
00381 EXTERNXML int rtXmlDecDecimal (OSCTXT* pctxt, OSREAL* pvalue,
00382                                int totalDigits, int fractionDigits);
00383 
00400 EXTERNXML int rtXmlDecDouble (OSCTXT* pctxt, OSREAL* pvalue,
00401                               int totalDigits, int fractionDigits);
00402 
00419 EXTERNXML int rtXmlDecDynBase64Str (OSCTXT* pctxt, OSDynOctStr* pvalue);
00420 
00436 EXTERNXML int rtXmlDecDynHexStr (OSCTXT* pctxt, OSDynOctStr* pvalue);
00437 
00451 EXTERNXML int rtXmlDecDynUTF8Str (OSCTXT* pctxt, const OSUTF8CHAR** outdata);
00452 
00469 EXTERNXML int rtXmlDecXmlStr (OSCTXT* pctxt, OSXMLSTRING* outdata);
00470 
00489 EXTERNXML int rtXmlDecHexBinary (OSMemBuf* pMemBuf, 
00490                                  const OSUTF8CHAR* inpdata, 
00491                                  int length);
00492 
00515 EXTERNXML int rtXmlDecHexStr (OSCTXT* pctxt, 
00516                               OSOCTET* pvalue, OSUINT16* pnocts, 
00517                               OSINT32 bufsize);
00518 
00519 EXTERNXML int rtXmlDecHexStrValue (OSCTXT* pctxt,
00520    const OSUTF8CHAR* const inpdata, size_t nbytes, OSOCTET* pvalue, 
00521    OSUINT32* pnbits, OSINT32 bufsize);
00522 
00535 EXTERNXML int rtXmlDecGYear (OSCTXT* pctxt, OSXSDDateTime* pvalue);
00536 
00549 EXTERNXML int rtXmlDecGYearMonth (OSCTXT* pctxt, OSXSDDateTime* pvalue);
00550 
00563 EXTERNXML int rtXmlDecGMonth (OSCTXT* pctxt, OSXSDDateTime* pvalue);
00564 
00577 EXTERNXML int rtXmlDecGMonthDay (OSCTXT* pctxt, OSXSDDateTime* pvalue);
00578 
00591 EXTERNXML int rtXmlDecGDay (OSCTXT* pctxt, OSXSDDateTime* pvalue);
00592 
00605 EXTERNXML int rtXmlDecInt (OSCTXT* pctxt, OSINT32* pvalue);
00606 
00620 EXTERNXML int rtXmlDecInt8 (OSCTXT* pctxt, OSINT8* pvalue);
00621 
00634 EXTERNXML int rtXmlDecInt16 (OSCTXT* pctxt, OSINT16* pvalue);
00635 
00648 EXTERNXML int rtXmlDecInt64 (OSCTXT* pctxt, OSINT64* pvalue);
00649 
00662 EXTERNXML int rtXmlDecUInt (OSCTXT* pctxt, OSUINT32* pvalue);
00663 
00677 EXTERNXML int rtXmlDecUInt8 (OSCTXT* pctxt, OSUINT8* pvalue);
00678 
00691 EXTERNXML int rtXmlDecUInt16 (OSCTXT* pctxt, OSUINT16* pvalue);
00692 
00705 EXTERNXML int rtXmlDecUInt64 (OSCTXT* pctxt, OSUINT64* pvalue);
00706 
00731 EXTERNXML const OSUTF8CHAR* rtXmlDecQName 
00732 (OSCTXT* pctxt, const OSUTF8CHAR* qname, const OSUTF8CHAR** prefix);
00733 
00746 EXTERNXML int rtXmlDecXSIAttr 
00747    (OSCTXT* pctxt, const OSUTF8CHAR* attrName, const OSUTF8CHAR* attrValue);
00748 
00763 EXTERNXML int rtXmlDecXSIAttrs (OSCTXT* pctxt, const OSUTF8CHAR* const* attrs,
00764    const char* typeName);
00765 
00778 EXTERNXML int rtXmlParseElementName (OSCTXT* pctxt, OSUTF8CHAR** ppName);
00779 
00792 EXTERNXML int rtXmlParseElemQName (OSCTXT* pctxt, OSXMLQName* pQName);
00793 
00820 EXTERNXML int rtXmlEncAny (OSCTXT* pctxt, OSXMLSTRING* pvalue, 
00821                            const OSUTF8CHAR* elemName, 
00822                            const OSUTF8CHAR* nsPrefix);
00823 
00834 EXTERNXML int rtXmlEncAnyAttr (OSCTXT* pctxt, OSRTDList* pAnyAttrList);
00835 
00836 #ifdef __cplusplus
00837 
00848 EXTERNXML int rtXmlCppEncAnyAttr 
00849    (OSCTXT* pctxt, OSRTObjListClass* pAnyAttrList);
00850 #endif
00851 
00867 EXTERNXML int rtXmlEncBase64Binary (OSCTXT* pctxt, OSUINT32 nocts, 
00868                                     const OSOCTET* value, 
00869                                     const OSUTF8CHAR* elemName, 
00870                                     const OSUTF8CHAR* nsPrefix);
00871 
00885 EXTERNXML int rtXmlEncBase64BinaryAttr 
00886    (OSCTXT* pctxt, OSUINT32 nocts, const OSOCTET* value,
00887     const OSUTF8CHAR* attrName, OSUINT16 attrNameLen);
00888 
00900 EXTERNXML int rtXmlEncBase64StrValue (OSCTXT* pctxt, OSUINT32 nocts, 
00901                                       const OSOCTET* value);
00902 
00927 EXTERNXML int rtXmlEncBigInt (OSCTXT* pctxt, const OSUTF8CHAR* value, 
00928                               const OSUTF8CHAR* elemName, 
00929                               const OSUTF8CHAR* nsPrefix);
00930 
00945 EXTERNXML int rtXmlEncBigIntAttr (OSCTXT* pctxt, const OSUTF8CHAR* value, 
00946                        const OSUTF8CHAR* attrName, OSUINT16 attrNameLen);
00947 
00961 EXTERNXML int rtXmlEncBigIntValue (OSCTXT* pctxt, const OSUTF8CHAR* value);
00962 
00977 EXTERNXML int rtXmlEncBool (OSCTXT* pctxt, OSBOOL value, 
00978                             const OSUTF8CHAR* elemName, 
00979                             const OSUTF8CHAR* nsPrefix);
00980 
00991 EXTERNXML int rtXmlEncBoolValue (OSCTXT* pctxt, OSBOOL value);
00992 
01004 EXTERNXML int rtXmlEncBoolAttr (OSCTXT* pctxt, OSBOOL value, 
01005                                 const OSUTF8CHAR* attrName, 
01006                                 OSUINT16 attrNameLen);
01007 
01025 EXTERNXML int rtXmlEncDate (OSCTXT* pctxt, const OSXSDDateTime* pvalue, 
01026                             const OSUTF8CHAR* elemName,
01027                             const OSUTF8CHAR* nsPrefix);
01028 
01042 EXTERNXML int rtXmlEncDateValue 
01043    (OSCTXT* pctxt, const OSXSDDateTime* pvalue);
01044 
01068 EXTERNXML int rtXmlEncTime (OSCTXT* pctxt, const OSXSDDateTime* pvalue,
01069                             const OSUTF8CHAR* elemName,
01070                             const OSUTF8CHAR* nsPrefix);
01071 
01084 EXTERNXML int rtXmlEncTimeValue 
01085    (OSCTXT* pctxt, const OSXSDDateTime* pvalue);
01086 
01102 EXTERNXML int rtXmlEncDateTime (OSCTXT* pctxt, const OSXSDDateTime* pvalue,
01103                                 const OSUTF8CHAR* elemName,
01104                                 const OSUTF8CHAR* nsPrefix);
01105 
01117 EXTERNXML int rtXmlEncDateTimeValue 
01118    (OSCTXT* pctxt, const OSXSDDateTime* pvalue);
01119 
01135 EXTERNXML int rtXmlEncDecimal (OSCTXT* pctxt, OSREAL value, 
01136                                const OSUTF8CHAR* elemName, 
01137                                const OSUTF8CHAR* nsPrefix,
01138                                const OSDecimalFmt* pFmtSpec);
01139 
01152 EXTERNXML int rtXmlEncDecimalAttr (OSCTXT* pctxt, OSREAL value, 
01153                                    const OSUTF8CHAR* attrName, 
01154                                    OSUINT16 attrNameLen,
01155                                    const OSDecimalFmt* pFmtSpec);
01156 
01174 EXTERNXML int rtXmlEncDecimalValue (OSCTXT* pctxt, OSREAL value,
01175                                     const OSDecimalFmt* pFmtSpec,
01176                                     char* pDestBuf, size_t destBufSize);
01177 
01193 EXTERNXML int rtXmlEncDouble (OSCTXT* pctxt, OSREAL value, 
01194                               const OSUTF8CHAR* elemName, 
01195                               const OSUTF8CHAR* nsPrefix,
01196                               const OSDoubleFmt* pFmtSpec);
01197 
01210 EXTERNXML int rtXmlEncDoubleAttr (OSCTXT* pctxt, OSREAL value, 
01211                                   const OSUTF8CHAR* attrName, 
01212                                   OSUINT16 attrNameLen,
01213                                   const OSDoubleFmt* pFmtSpec);
01214 
01228 EXTERNXML int rtXmlEncDoubleValue (OSCTXT* pctxt, OSREAL value,
01229                                    const OSDoubleFmt* pFmtSpec,
01230                                    int defaultPrecision);
01231 
01244 EXTERNXML int rtXmlEncEmptyElement (OSCTXT* pctxt, 
01245                                     const OSUTF8CHAR* elemName, 
01246                                     const OSUTF8CHAR* nsPrefix, 
01247                                     OSBOOL terminate);
01248 
01249 EXTERNXML int rtXmlEncEmptyElement2 (OSCTXT* pctxt, 
01250                                      const OSUTF8CHAR* elemName, 
01251                                      size_t elemLen,
01252                                      const OSUTF8CHAR* nsPrefix, 
01253                                      size_t nsPrefixLen, 
01254                                      OSBOOL terminate);
01255 
01265 EXTERNXML int rtXmlEncEndDocument (OSCTXT* pctxt);
01266 
01278 EXTERNXML int rtXmlEncEndElement (OSCTXT* pctxt, 
01279                                   const OSUTF8CHAR* elemName, 
01280                                   const OSUTF8CHAR* nsPrefix);
01281 
01282 EXTERNXML int rtXmlEncEndElement2 (OSCTXT* pctxt, 
01283                                    const OSUTF8CHAR* elemName, 
01284                                    size_t elemLen, 
01285                                    const OSUTF8CHAR* nsPrefix, 
01286                                    size_t nsPrefixLen);
01287 
01297 EXTERNXML int rtXmlEncEndSoapEnv (OSCTXT* pctxt); 
01298 
01314 EXTERNXML int rtXmlEncFloat (OSCTXT* pctxt, OSREAL value, 
01315                              const OSUTF8CHAR* elemName, 
01316                              const OSUTF8CHAR* nsPrefix,
01317                              const OSDoubleFmt* pFmtSpec);
01318 
01331 EXTERNXML int rtXmlEncFloatAttr (OSCTXT* pctxt, OSREAL value, 
01332                                  const OSUTF8CHAR* attrName, 
01333                                  OSUINT16 attrNameLen,
01334                                  const OSDoubleFmt* pFmtSpec);
01335 
01351 EXTERNXML int rtXmlEncHexBinary (OSCTXT* pctxt, OSUINT32 nocts, 
01352                                  const OSOCTET* value, 
01353                                  const OSUTF8CHAR* elemName, 
01354                                  const OSUTF8CHAR* nsPrefix);
01355 
01368 EXTERNXML int rtXmlEncHexBinaryAttr 
01369    (OSCTXT* pctxt, OSUINT32 nocts, const OSOCTET* value,
01370     const OSUTF8CHAR* attrName, OSUINT16 attrNameLen);
01371 
01383 EXTERNXML int rtXmlEncHexStrValue (OSCTXT* pctxt, 
01384                                    OSUINT32 nocts, 
01385                                    const OSOCTET* data);
01386 
01402 EXTERNXML int rtXmlEncGYear (OSCTXT* pctxt, const OSXSDDateTime* pvalue,
01403                    const OSUTF8CHAR* elemName,
01404                    const OSUTF8CHAR* nsPrefix);
01405 
01421 EXTERNXML int rtXmlEncGYearMonth (OSCTXT* pctxt, const OSXSDDateTime* pvalue,
01422                         const OSUTF8CHAR* elemName,
01423                         const OSUTF8CHAR* nsPrefix);
01424 
01440 EXTERNXML int rtXmlEncGMonth (OSCTXT* pctxt, const OSXSDDateTime* pvalue,
01441                     const OSUTF8CHAR* elemName,
01442                     const OSUTF8CHAR* nsPrefix);
01443 
01459 EXTERNXML int rtXmlEncGMonthDay (OSCTXT* pctxt, const OSXSDDateTime* pvalue,
01460                        const OSUTF8CHAR* elemName,
01461                        const OSUTF8CHAR* nsPrefix);
01462 
01478 EXTERNXML int rtXmlEncGDay (OSCTXT* pctxt, const OSXSDDateTime* pvalue,
01479                        const OSUTF8CHAR* elemName,
01480                        const OSUTF8CHAR* nsPrefix);
01481 
01493 EXTERNXML int rtXmlEncGYearValue 
01494    (OSCTXT* pctxt, const OSXSDDateTime* pvalue);
01495 
01507 EXTERNXML int rtXmlEncGYearMonthValue 
01508    (OSCTXT* pctxt, const OSXSDDateTime* pvalue);
01509 
01521 EXTERNXML int rtXmlEncGMonthValue 
01522    (OSCTXT* pctxt, const OSXSDDateTime* pvalue);
01523 
01535 EXTERNXML int rtXmlEncGMonthDayValue 
01536    (OSCTXT* pctxt, const OSXSDDateTime* pvalue);
01537 
01549 EXTERNXML int rtXmlEncGDayValue 
01550    (OSCTXT* pctxt, const OSXSDDateTime* pvalue);
01551 
01562 EXTERNXML int rtXmlEncIndent (OSCTXT* pctxt);
01563 
01578 EXTERNXML int rtXmlEncInt (OSCTXT* pctxt, OSINT32 value, 
01579                            const OSUTF8CHAR* elemName, 
01580                            const OSUTF8CHAR* nsPrefix);
01581 
01592 EXTERNXML int rtXmlEncIntValue (OSCTXT* pctxt, OSINT32 value);
01593 
01606 EXTERNXML int rtXmlEncIntAttr (OSCTXT* pctxt, OSINT32 value, 
01607                                const OSUTF8CHAR* attrName, 
01608                                OSUINT16 attrNameLen);
01609 
01626 EXTERNXML int rtXmlEncIntPattern (OSCTXT* pctxt, OSINT32 value, 
01627                                   const OSUTF8CHAR* elemName, 
01628                                   const OSUTF8CHAR* nsPrefix, 
01629                                   const OSUTF8CHAR* pattern);
01630 
01631 EXTERNXML int rtXmlEncIntPatternValue (OSCTXT* pctxt, OSINT32 value, 
01632                                        const OSUTF8CHAR* pattern);
01633 
01649 EXTERNXML int rtXmlEncInt64 (OSCTXT* pctxt, OSINT64 value, 
01650                              const OSUTF8CHAR* elemName, 
01651                              const OSUTF8CHAR* nsPrefix);
01652 
01664 EXTERNXML int rtXmlEncInt64Value (OSCTXT* pctxt, OSINT64 value);
01665 
01679 EXTERNXML int rtXmlEncInt64Attr (OSCTXT* pctxt, OSINT64 value, 
01680                                  const OSUTF8CHAR* attrName, 
01681                                  OSUINT16 attrNameLen);
01682 
01694 EXTERNXML int rtXmlEncNSAttrs (OSCTXT* pctxt);
01695 
01709 EXTERNXML int rtXmlEncSoapArrayTypeAttr 
01710 (OSCTXT* pctxt, const OSUTF8CHAR* name, const OSUTF8CHAR* value, 
01711  size_t itemCount);
01712 
01713 EXTERNXML int rtXmlEncSoapArrayTypeAttr2 
01714 (OSCTXT* pctxt, const OSUTF8CHAR* name, size_t nameLen, 
01715  const OSUTF8CHAR* value, size_t valueLen, size_t itemCount);
01716 
01728 EXTERNXML int rtXmlEncStartDocument (OSCTXT* pctxt);
01729 
01742 EXTERNXML int rtXmlEncStartElement (OSCTXT* pctxt, 
01743                                     const OSUTF8CHAR* elemName, 
01744                                     const OSUTF8CHAR* nsPrefix, 
01745                                     OSBOOL terminate);
01746 
01761 EXTERNXML int rtXmlEncStartElement2 (OSCTXT* pctxt, 
01762                                      const OSUTF8CHAR* elemName, 
01763                                      size_t elemLen,
01764                                      const OSUTF8CHAR* nsPrefix, 
01765                                      size_t nsPrefixLen,
01766                                      OSBOOL terminate);
01767 
01777 EXTERNXML int rtXmlEncStartSoapEnv (OSCTXT* pctxt); 
01778 
01793 EXTERNXML int rtXmlEncString (OSCTXT* pctxt, 
01794                               OSXMLSTRING* pxmlstr, 
01795                               const OSUTF8CHAR* elemName, 
01796                               const OSUTF8CHAR* nsPrefix);
01797 
01807 EXTERNXML int rtXmlEncStringValue (OSCTXT* pctxt, const OSUTF8CHAR* value);
01808 
01819 EXTERNXML int rtXmlEncStringValue2 
01820    (OSCTXT* pctxt, const OSUTF8CHAR* value, size_t valueLen);
01821 
01833 EXTERNXML int rtXmlEncUTF8Attr (OSCTXT* pctxt, 
01834                                 const OSUTF8CHAR* name, 
01835                                 const OSUTF8CHAR* value);
01836 
01850 EXTERNXML int rtXmlEncUTF8Attr2 (OSCTXT* pctxt, 
01851                                  const OSUTF8CHAR* name, size_t nameLen, 
01852                                  const OSUTF8CHAR* value, size_t valueLen);
01853 
01868 EXTERNXML int rtXmlEncUTF8Str (OSCTXT* pctxt, 
01869                                const OSUTF8CHAR* value,
01870                                const OSUTF8CHAR* elemName, 
01871                                const OSUTF8CHAR* nsPrefix);
01872 
01887 EXTERNXML int rtXmlEncUInt (OSCTXT* pctxt, OSUINT32 value, 
01888                             const OSUTF8CHAR* elemName, 
01889                             const OSUTF8CHAR* nsPrefix);
01890 
01902 EXTERNXML int rtXmlEncUIntValue (OSCTXT* pctxt, OSUINT32 value);
01903 
01916 EXTERNXML int rtXmlEncUIntAttr (OSCTXT* pctxt, OSUINT32 value, 
01917                                 const OSUTF8CHAR* attrName, 
01918                                 OSUINT16 attrNameLen);
01919 
01936 EXTERNXML int rtXmlEncUInt64 (OSCTXT* pctxt, OSUINT64 value, 
01937                               const OSUTF8CHAR* elemName, 
01938                               const OSUTF8CHAR* nsPrefix);
01939 
01952 EXTERNXML int rtXmlEncUInt64Value (OSCTXT* pctxt, OSUINT64 value);
01953 
01967 EXTERNXML int rtXmlEncUInt64Attr (OSCTXT* pctxt, OSUINT64 value, 
01968                                   const OSUTF8CHAR* attrName, 
01969                                   OSUINT16 attrNameLen);
01970 
01987 EXTERNXML int rtXmlEncXSIAttrs (OSCTXT* pctxt, OSBOOL needXSI);
01988 
01999 EXTERNXML int rtXmlFreeInputSource (OSCTXT* pctxt);
02000 
02001 EXTERNXML OSBOOL rtXmlStrCmpAsc (const OSUTF8CHAR* text1, const char* text2);
02002 
02003 EXTERNXML OSBOOL rtXmlStrnCmpAsc (const OSUTF8CHAR* text1, 
02004                                   const char* text2, size_t len);
02005 
02006 /*EXTERNXML int rtXmlFinalizeMemBuf (OSMemBuf* pMemBuf);*/
02007 
02008 #define rtXmlFinalizeMemBuf(pMemBuf) do { \
02009 (pMemBuf)->pctxt->buffer.data = (pMemBuf)->buffer + (pMemBuf)->startidx; \
02010 (pMemBuf)->pctxt->buffer.size =                                      \
02011 ((pMemBuf)->usedcnt - (pMemBuf)->startidx);                          \
02012 (pMemBuf)->pctxt->buffer.dynamic = FALSE;                            \
02013 (pMemBuf)->pctxt->buffer.byteIndex = 0;                              \
02014 rtxMemBufReset (pMemBuf);                                            \
02015 } while(0)
02016 
02039 EXTERNXML int rtXmlSetEncBufPtr 
02040 (OSCTXT* pctxt, OSOCTET* bufaddr, size_t bufsiz);
02041 
02050 #define rtXmlGetEncBufPtr(pctxt) (pctxt)->buffer.data
02051 
02057 #define rtXmlGetEncBufLen(pctxt) (pctxt)->buffer.byteIndex
02058 
02059 
02067 EXTERNXML int rtXmlGetIndent (OSCTXT* pctxt);
02068 
02077 EXTERNXML int rtXmlGetIndentChar (OSCTXT* pctxt);
02082 EXTERNXML int rtXmlSetDigitsFacets 
02083    (OSCTXT* pctxt, int totalDigits, int fractionDigits);
02084 
02095 EXTERNXML int rtXmlSetEncDocHdr (OSCTXT* pctxt, OSBOOL value);
02096 
02106 EXTERNXML int rtXmlSetEncoding (OSCTXT* pctxt, OSXMLEncoding encoding);
02107 
02123 EXTERNXML int rtXmlSetFormatting (OSCTXT* pctxt, OSBOOL doFormatting);
02124 
02133 EXTERNXML int rtXmlSetIndent (OSCTXT* pctxt, OSUINT8 indent);
02134 
02143 EXTERNXML int rtXmlSetIndentChar (OSCTXT* pctxt, char indentChar);
02144 
02156 EXTERNXML int rtXmlSetSchemaLocation 
02157 (OSCTXT* pctxt, const OSUTF8CHAR* schemaLocation);
02158 
02170 EXTERNXML int rtXmlSetNoNSSchemaLocation 
02171 (OSCTXT* pctxt, const OSUTF8CHAR* schemaLocation);
02172 
02183 EXTERNXML int rtXmlSetXSITypeAttr (OSCTXT* pctxt, const OSUTF8CHAR* xsiType);
02184 
02193 EXTERNXML int rtXmlSetEncodingStr (OSCTXT* pctxt, const OSUTF8CHAR* encodingStr);
02194 
02195 #include "rtxmlsrc/rtXmlNamespace.h"
02196 
02210 EXTERNXML int rtXmlMatchHexStr 
02211 (OSCTXT* pctxt, size_t minLength, size_t maxLength);
02212 
02226 EXTERNXML int rtXmlMatchBase64Str 
02227 (OSCTXT* pctxt, size_t minLength, size_t maxLength);
02228 
02240 EXTERNXML int rtXmlMatchDate (OSCTXT* pctxt);
02241 
02253 EXTERNXML int rtXmlMatchTime (OSCTXT* pctxt);
02254 
02266 EXTERNXML int rtXmlMatchDateTime (OSCTXT* pctxt);
02267 
02279 EXTERNXML int rtXmlMatchGYear (OSCTXT* pctxt);
02280 
02292 EXTERNXML int rtXmlMatchGYearMonth (OSCTXT* pctxt);
02293 
02305 EXTERNXML int rtXmlMatchGMonth (OSCTXT* pctxt);
02306 
02318 EXTERNXML int rtXmlMatchGMonthDay (OSCTXT* pctxt);
02319 
02331 EXTERNXML int rtXmlMatchGDay (OSCTXT* pctxt);
02332 
02333 /* not supported yet */
02334 EXTERNXML OSBOOL rtXmlCmpBase64Str (OSCTXT* pctxt, 
02335                                     OSUINT32 nocts1, 
02336                                     const OSOCTET* data1,
02337                                     const OSUTF8CHAR* data2);
02338 
02339 /* not supported yet */
02340 EXTERNXML OSBOOL rtXmlCmpHexStr (OSCTXT* pctxt, 
02341                                  OSUINT32 nocts1, 
02342                                  const OSOCTET* data1,
02343                                  const OSUTF8CHAR* data2);
02344 
02345 EXTERNXML int rtSaxGetAttributeID (OSCTXT* pctxt, 
02346                                    const OSUTF8CHAR* attrName,
02347                                    size_t nAttr, 
02348                                    const OSUTF8CHAR* attrNames[],
02349                                    OSUINT32 attrPresent[]);
02350 
02365 EXTERNXML int rtSaxGetElemID 
02366 (OSINT16* pState, OSINT16 prevElemIdx, const OSUTF8CHAR* localName, 
02367  const OSSAXElemTableRec idtab[], const int* fstab, 
02368  int fstabRows, int fstabCols);
02369 
02384 EXTERNXML int rtSaxGetElemID8 
02385 (OSINT16* pState, OSINT16 prevElemIdx, const OSUTF8CHAR* localName, 
02386  const OSSAXElemTableRec idtab[], const OSINT8* fstab, 
02387  int fstabRows, int fstabCols);
02388 
02389 EXTERNXML int rtSaxFindElemID (OSINT16* pState, OSINT16 prevElemIdx,
02390                                const OSUTF8CHAR* localName, 
02391                                const OSSAXElemTableRec idtab[], 
02392                                const int* fstab,
02393                                int fstabRows, int fstabCols);
02394 
02395 EXTERNXML int rtSaxFindElemID8 (OSINT16* pState, OSINT16 prevElemIdx,
02396                                 const OSUTF8CHAR* localName, 
02397                                 const OSSAXElemTableRec idtab[], 
02398                                 const OSINT8* fstab,
02399                                 int fstabRows, int fstabCols);
02400 
02412 EXTERNXML OSBOOL rtSaxIsEmptyBuffer (OSCTXT* pctxt, int whitespace);
02413 
02414 EXTERNXML int rtSaxLookupElemID (OSCTXT* pctxt, OSINT16* pState, 
02415                          OSINT16 prevElemIdx,
02416                          const OSUTF8CHAR* localName, const OSUTF8CHAR* qName,
02417                          const OSSAXElemTableRec idtab[], 
02418                          const int* fstab,
02419                          int fstabRows, int fstabCols);
02420 
02421 EXTERNXML int rtSaxLookupElemID8 (OSCTXT* pctxt, OSINT16* pState, 
02422                          OSINT16 prevElemIdx,
02423                          const OSUTF8CHAR* localName, const OSUTF8CHAR* qName,
02424                          const OSSAXElemTableRec idtab[], 
02425                          const OSINT8* fstab,
02426                          int fstabRows, int fstabCols);
02427 
02439 EXTERNXML int rtSaxStrListParse 
02440    (OSCTXT* pctxt, OSMemBuf *pMemBuf, OSRTDList* pvalue);
02441 
02449 EXTERNXML int rtSaxStrListMatch (OSCTXT* pctxt);
02450 
02451 EXTERNXML OSBOOL rtSaxTestFinal (OSINT16 state, 
02452                                  OSINT16 currElemIdx,
02453                                  const int* fstab,
02454                                  int fstabRows, int fstabCols);
02455 
02456 EXTERNXML OSBOOL rtSaxTestFinal8 (OSINT16 state, 
02457                                   OSINT16 currElemIdx,
02458                                   const