rtXmlNamespace.h
Go to the documentation of this file.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 OSXSDNSURI "http://www.w3.org/2001/XMLSchema"
00040
00041 typedef struct OSXMLNamespace {
00042 const OSUTF8CHAR* prefix;
00043 const OSUTF8CHAR* uri;
00044 } OSXMLNamespace;
00045
00046
00047
00048 typedef struct OSXMLNSPfxLink {
00049 OSINT32 nsidx;
00050 OSXMLNamespace ns;
00051 OSRTDynPtrArray extraPrefixes;
00052 struct OSXMLNSPfxLink* next;
00053 } OSXMLNSPfxLink;
00054
00055
00056 typedef struct OSXMLNSPfxLinkStackNode {
00057 struct OSXMLNSPfxLink* link;
00058 struct OSXMLNSPfxLinkStackNode* next;
00059 } OSXMLNSPfxLinkStackNode;
00060
00061
00062
00063
00064 typedef struct OSXMLNSPfxLinkStack {
00065 OSINT32 count;
00066 OSXMLNSPfxLinkStackNode* top;
00067 } OSXMLNSPfxLinkStack;
00068
00069
00070 typedef struct OSXMLNSURITable {
00071 OSUINT32 nrows;
00072 const OSUTF8CHAR** data;
00073 } OSXMLNSURITable;
00074
00075 #ifdef __cplusplus
00076 extern "C" {
00077 #endif
00078
00089 EXTERNXML OSXMLNamespace* rtXmlNSAddNamespace
00090 (OSCTXT* pctxt, OSRTDList* pNSAttrs, const OSUTF8CHAR* prefix,
00091 const OSUTF8CHAR* uri);
00092
00102 EXTERNXML OSBOOL rtXmlNSEqual (OSXMLNamespace* pNS1, OSXMLNamespace* pNS2);
00103
00111 EXTERNXML void rtXmlNSFreeAttrList (OSCTXT* pctxt, OSRTDList* pNSAttrs);
00112
00124 EXTERNXML const OSUTF8CHAR* rtXmlNSGetPrefix
00125 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00126
00139 EXTERNXML const OSUTF8CHAR* rtXmlNSGetPrefixUsingIndex
00140 (OSCTXT* pctxt, const OSUTF8CHAR* uri, OSUINT32 idx);
00141
00150 EXTERNXML OSUINT32 rtXmlNSGetPrefixCount
00151 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00152
00167 EXTERNXML int rtXmlNSGetPrefixIndex
00168 (OSCTXT* pctxt, const OSUTF8CHAR* uri, const OSUTF8CHAR* prefix,
00169 OSUINT32* pcount);
00170
00182 EXTERNXML const OSUTF8CHAR* rtXmlNSGetQName
00183 (OSCTXT* pctxt, OSUTF8CHAR* buf, size_t bufsiz, const OSUTF8CHAR* uri,
00184 const OSUTF8CHAR* localName);
00185
00199 EXTERNXML const OSUTF8CHAR* rtXmlNSGetAttrQName
00200 (OSCTXT* pctxt, OSUTF8CHAR* buf, size_t bufsiz, OSXMLNamespace* pNS,
00201 const OSUTF8CHAR* localName, OSRTDList* pNSAttrs);
00202
00211 EXTERNXML OSXMLNamespace* rtXmlNSLookupURI
00212 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00213
00222 EXTERNXML OSXMLNamespace* rtXmlNSLookupURIInList
00223 (OSRTDList* pNSAttrs, const OSUTF8CHAR* uri);
00224
00225
00236 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefixForURI
00237 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00238
00239
00248 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefix
00249 (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00250
00260 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefixFrag
00261 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, size_t prefixLen);
00262
00269 EXTERNXML void rtXmlNSRemoveAll (OSCTXT* pctxt);
00270
00287 EXTERNXML OSXMLNamespace* rtXmlNSSetNamespace
00288 (OSCTXT* pctxt, OSRTDList* pNSAttrs, const OSUTF8CHAR* prefix,
00289 const OSUTF8CHAR* uri, OSBOOL override);
00290
00301 EXTERNXML const OSUTF8CHAR* rtXmlNSNewPrefix
00302 (OSCTXT* pctxt, const OSUTF8CHAR* uri, OSRTDList* pNSAttrs);
00303
00313 #define RTXMLNSSETQNAME(qname,pNS) \
00314 if (0 != pNS) { qname.nsPrefix = pNS->prefix; qname.nsURI = pNS->uri; } \
00315 else { qname.nsPrefix = qname.nsURI = 0; }
00316
00320 EXTERNXML int rtXmlNSAddPrefixLink
00321 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, const OSUTF8CHAR* uri,
00322 const OSUTF8CHAR* nsTable[], OSUINT32 nsTableRowCount);
00323
00327 EXTERNXML int rtXmlNSFreeAllPrefixLinks
00328 (OSCTXT* pctxt, OSXMLNSPfxLinkStackNode* pStackNode);
00329
00333 EXTERNXML int rtXmlNSFreePrefixLink (OSCTXT* pctxt, OSXMLNSPfxLink* plink);
00334
00339 EXTERNXML int rtXmlNSGetIndex (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00340
00344 EXTERNXML int rtXmlNSPush (OSCTXT* pctxt);
00345
00349 EXTERNXML int rtXmlNSPop (OSCTXT* pctxt);
00350
00354 EXTERNXML void rtXmlNSSetURITable
00355 (OSCTXT* pctxt, const OSUTF8CHAR* data[], OSUINT32 nrows);
00356
00357 #ifdef __cplusplus
00358 }
00359 #endif
00360
00361 #endif