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
00120 EXTERNXML const OSUTF8CHAR* rtXmlNSGetPrefix
00121 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00122
00135 EXTERNXML const OSUTF8CHAR* rtXmlNSGetPrefixUsingIndex
00136 (OSCTXT* pctxt, const OSUTF8CHAR* uri, OSUINT32 idx);
00137
00146 EXTERNXML OSUINT32 rtXmlNSGetPrefixCount
00147 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00148
00163 EXTERNXML int rtXmlNSGetPrefixIndex
00164 (OSCTXT* pctxt, const OSUTF8CHAR* uri, const OSUTF8CHAR* prefix,
00165 OSUINT32* pcount);
00166
00178 EXTERNXML const OSUTF8CHAR* rtXmlNSGetQName
00179 (OSCTXT* pctxt, OSUTF8CHAR* buf, size_t bufsiz, const OSUTF8CHAR* uri,
00180 const OSUTF8CHAR* localName);
00181
00195 EXTERNXML const OSUTF8CHAR* rtXmlNSGetAttrQName
00196 (OSCTXT* pctxt, OSUTF8CHAR* buf, size_t bufsiz, OSXMLNamespace* pNS,
00197 const OSUTF8CHAR* localName, OSRTDList* pNSAttrs);
00198
00207 EXTERNXML OSXMLNamespace* rtXmlNSLookupURI
00208 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00209
00218 EXTERNXML OSXMLNamespace* rtXmlNSLookupURIInList
00219 (OSRTDList* pNSAttrs, const OSUTF8CHAR* uri);
00220
00229 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefix
00230 (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00231
00241 EXTERNXML const OSUTF8CHAR* rtXmlNSLookupPrefixFrag
00242 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, size_t prefixLen);
00243
00250 EXTERNXML void rtXmlNSRemoveAll (OSCTXT* pctxt);
00251
00268 EXTERNXML OSXMLNamespace* rtXmlNSSetNamespace
00269 (OSCTXT* pctxt, OSRTDList* pNSAttrs, const OSUTF8CHAR* prefix,
00270 const OSUTF8CHAR* uri, OSBOOL override);
00271
00282 EXTERNXML const OSUTF8CHAR* rtXmlNSNewPrefix
00283 (OSCTXT* pctxt, const OSUTF8CHAR* uri, OSRTDList* pNSAttrs);
00284
00294 #define RTXMLNSSETQNAME(qname,pNS) \
00295 if (0 != pNS) { qname.nsPrefix = pNS->prefix; qname.nsURI = pNS->uri; } \
00296 else { qname.nsPrefix = qname.nsURI = 0; }
00297
00301 EXTERNXML int rtXmlNSAddPrefixLink
00302 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, const OSUTF8CHAR* uri,
00303 const OSUTF8CHAR* nsTable[], OSUINT32 nsTableRowCount);
00304
00308 EXTERNXML int rtXmlNSFreeAllPrefixLinks
00309 (OSCTXT* pctxt, OSXMLNSPfxLinkStackNode* pStackNode);
00310
00314 EXTERNXML int rtXmlNSFreePrefixLink (OSCTXT* pctxt, OSXMLNSPfxLink* plink);
00315
00320 EXTERNXML int rtXmlNSGetIndex (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00321
00325 EXTERNXML int rtXmlNSPush (OSCTXT* pctxt);
00326
00330 EXTERNXML int rtXmlNSPop (OSCTXT* pctxt);
00331
00335 EXTERNXML void rtXmlNSSetURITable
00336 (OSCTXT* pctxt, const OSUTF8CHAR* data[], OSUINT32 nrows);
00337
00338 #ifdef __cplusplus
00339 }
00340 #endif
00341
00342 #endif