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
00198 EXTXMLMETHOD const OSUTF8CHAR* rtXmlNSGetAttrPrefix (OSCTXT* pctxt,
00199 const OSUTF8CHAR* namespaceURI, OSRTDList* pNSAttrs);
00200
00215 EXTERNXML const OSUTF8CHAR* rtXmlNSGetAttrQName
00216 (OSCTXT* pctxt, OSUTF8CHAR* buf, size_t bufsiz, OSXMLNamespace* pNS,
00217 const OSUTF8CHAR* localName, OSRTDList* pNSAttrs);
00218
00227 EXTERNXML OSXMLNamespace* rtXmlNSLookupURI
00228 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00229
00238 EXTERNXML OSXMLNamespace* rtXmlNSLookupURIInList
00239 (OSRTDList* pNSAttrs, const OSUTF8CHAR* uri);
00240
00241
00252 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefixForURI
00253 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00254
00255
00264 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefix
00265 (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00266
00276 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefixFrag
00277 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, size_t prefixLen);
00278
00285 EXTERNXML void rtXmlNSRemoveAll (OSCTXT* pctxt);
00286
00303 EXTERNXML OSXMLNamespace* rtXmlNSSetNamespace
00304 (OSCTXT* pctxt, OSRTDList* pNSAttrs, const OSUTF8CHAR* prefix,
00305 const OSUTF8CHAR* uri, OSBOOL override);
00306
00318 EXTERNXML const OSUTF8CHAR* rtXmlNSNewPrefix
00319 (OSCTXT* pctxt, const OSUTF8CHAR* uri, OSRTDList* pNSAttrs);
00320
00330 #define RTXMLNSSETQNAME(qname,pNS) \
00331 if (0 != pNS) { qname.nsPrefix = pNS->prefix; qname.nsURI = pNS->uri; } \
00332 else { qname.nsPrefix = qname.nsURI = 0; }
00333
00337 EXTERNXML int rtXmlNSAddPrefixLink
00338 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, const OSUTF8CHAR* uri,
00339 const OSUTF8CHAR* nsTable[], OSUINT32 nsTableRowCount);
00340
00344 EXTERNXML int rtXmlNSFreeAllPrefixLinks
00345 (OSCTXT* pctxt, OSXMLNSPfxLinkStackNode* pStackNode);
00346
00350 EXTERNXML int rtXmlNSFreePrefixLink (OSCTXT* pctxt, OSXMLNSPfxLink* plink);
00351
00356 EXTERNXML int rtXmlNSGetIndex (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00357
00361 EXTERNXML int rtXmlNSPush (OSCTXT* pctxt);
00362
00366 EXTERNXML int rtXmlNSPop (OSCTXT* pctxt);
00367
00371 EXTERNXML void rtXmlNSSetURITable
00372 (OSCTXT* pctxt, const OSUTF8CHAR* data[], OSUINT32 nrows);
00373
00374 #ifdef __cplusplus
00375 }
00376 #endif
00377
00378 #endif