00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028 #ifndef _RTXMLNAMESPACE_H_
00029 #define _RTXMLNAMESPACE_H_
00030
00031 #include "rtxsrc/rtxContext.h"
00032 #include "rtxsrc/rtxDynPtrArray.h"
00033 #include "rtxsrc/rtxXmlQName.h"
00034 #include "rtxmlsrc/rtXmlExternDefs.h"
00035
00036
00037 #define OSXMLNSURI "http://www.w3.org/XML/1998/namespace"
00038 #define OSXSINSURI "http://www.w3.org/2001/XMLSchema-instance"
00039 #define OSXSINSURI_LEN 41
00040 #define OSXSDNSURI "http://www.w3.org/2001/XMLSchema"
00041
00042 typedef struct OSXMLNamespace {
00043 const OSUTF8CHAR* prefix;
00044 const OSUTF8CHAR* uri;
00045 } OSXMLNamespace;
00046
00047
00048
00049 typedef struct OSXMLNSPfxLink {
00050 OSINT32 nsidx;
00051 OSXMLNamespace ns;
00052 OSRTDynPtrArray extraPrefixes;
00053 struct OSXMLNSPfxLink* next;
00054 } OSXMLNSPfxLink;
00055
00056
00057 typedef struct OSXMLNSPfxLinkStackNode {
00058 struct OSXMLNSPfxLink* link;
00059 struct OSXMLNSPfxLinkStackNode* next;
00060 } OSXMLNSPfxLinkStackNode;
00061
00062
00063
00064
00065 typedef struct OSXMLNSPfxLinkStack {
00066 OSINT32 count;
00067 OSXMLNSPfxLinkStackNode* top;
00068 } OSXMLNSPfxLinkStack;
00069
00070
00071 typedef struct OSXMLNSURITable {
00072 OSUINT32 nrows;
00073 const OSUTF8CHAR** data;
00074 } OSXMLNSURITable;
00075
00076 #ifdef __cplusplus
00077 extern "C" {
00078 #endif
00079
00090 EXTERNXML OSXMLNamespace* rtXmlNSAddNamespace
00091 (OSCTXT* pctxt, OSRTDList* pNSAttrs, const OSUTF8CHAR* prefix,
00092 const OSUTF8CHAR* uri);
00093
00103 EXTERNXML OSBOOL rtXmlNSEqual (OSXMLNamespace* pNS1, OSXMLNamespace* pNS2);
00104
00112 EXTERNXML void rtXmlNSFreeAttrList (OSCTXT* pctxt, OSRTDList* pNSAttrs);
00113
00125 EXTERNXML const OSUTF8CHAR* rtXmlNSGetPrefix
00126 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00127
00140 EXTERNXML const OSUTF8CHAR* rtXmlNSGetPrefixUsingIndex
00141 (OSCTXT* pctxt, const OSUTF8CHAR* uri, OSUINT32 idx);
00142
00151 EXTERNXML OSUINT32 rtXmlNSGetPrefixCount
00152 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00153
00168 EXTERNXML int rtXmlNSGetPrefixIndex
00169 (OSCTXT* pctxt, const OSUTF8CHAR* uri, const OSUTF8CHAR* prefix,
00170 OSUINT32* pcount);
00171
00183 EXTERNXML const OSUTF8CHAR* rtXmlNSGetQName
00184 (OSCTXT* pctxt, OSUTF8CHAR* buf, size_t bufsiz, const OSUTF8CHAR* uri,
00185 const OSUTF8CHAR* localName);
00186
00200 EXTERNXML const OSUTF8CHAR* rtXmlNSGetAttrQName
00201 (OSCTXT* pctxt, OSUTF8CHAR* buf, size_t bufsiz, OSXMLNamespace* pNS,
00202 const OSUTF8CHAR* localName, OSRTDList* pNSAttrs);
00203
00212 EXTERNXML OSXMLNamespace* rtXmlNSLookupURI
00213 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00214
00223 EXTERNXML OSXMLNamespace* rtXmlNSLookupURIInList
00224 (OSRTDList* pNSAttrs, const OSUTF8CHAR* uri);
00225
00226
00237 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefixForURI
00238 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00239
00240
00249 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefix
00250 (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00251
00261 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefixFrag
00262 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, size_t prefixLen);
00263
00270 EXTERNXML void rtXmlNSRemoveAll (OSCTXT* pctxt);
00271
00288 EXTERNXML OSXMLNamespace* rtXmlNSSetNamespace
00289 (OSCTXT* pctxt, OSRTDList* pNSAttrs, const OSUTF8CHAR* prefix,
00290 const OSUTF8CHAR* uri, OSBOOL override);
00291
00302 EXTERNXML const OSUTF8CHAR* rtXmlNSNewPrefix
00303 (OSCTXT* pctxt, const OSUTF8CHAR* uri, OSRTDList* pNSAttrs);
00304
00314 #define RTXMLNSSETQNAME(qname,pNS) \
00315 if (0 != pNS) { qname.nsPrefix = pNS->prefix; qname.nsURI = pNS->uri; } \
00316 else { qname.nsPrefix = qname.nsURI = 0; }
00317
00321 EXTERNXML int rtXmlNSAddPrefixLink
00322 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, const OSUTF8CHAR* uri,
00323 const OSUTF8CHAR* nsTable[], OSUINT32 nsTableRowCount);
00324
00328 EXTERNXML int rtXmlNSFreeAllPrefixLinks
00329 (OSCTXT* pctxt, OSXMLNSPfxLinkStackNode* pStackNode);
00330
00334 EXTERNXML int rtXmlNSFreePrefixLink (OSCTXT* pctxt, OSXMLNSPfxLink* plink);
00335
00340 EXTERNXML int rtXmlNSGetIndex (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00341
00345 EXTERNXML int rtXmlNSPush (OSCTXT* pctxt);
00346
00350 EXTERNXML int rtXmlNSPop (OSCTXT* pctxt);
00351
00355 EXTERNXML void rtXmlNSSetURITable
00356 (OSCTXT* pctxt, const OSUTF8CHAR* data[], OSUINT32 nrows);
00357
00358 #ifdef __cplusplus
00359 }
00360 #endif
00361
00362 #endif