Home > Support > Documentation

rtXmlNamespace.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2007 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 _RTXMLNAMESPACE_H_
00029 #define _RTXMLNAMESPACE_H_
00030 
00031 #include "rtxsrc/rtxContext.h"
00032 
00033 typedef struct OSXMLNamespace {
00034    const OSUTF8CHAR* prefix;
00035    const OSUTF8CHAR* uri;
00036 } OSXMLNamespace;
00037 
00038 /* This structure links a namespace prefix to an entry in a generated 
00039    namespace table. */
00040 typedef struct OSXMLNSPfxLink {
00041    OSXMLNamespace ns;
00042    OSINT32 nsidx;
00043    struct OSXMLNSPfxLink* next;
00044 } OSXMLNSPfxLink;
00045 
00046 /* Node in namespace-prefix link stack */
00047 typedef struct OSXMLNSPfxLinkStackNode {
00048    struct OSXMLNSPfxLink* link;
00049    struct OSXMLNSPfxLinkStackNode* next;
00050 } OSXMLNSPfxLinkStackNode;
00051 
00052 /* This structure is used to maintain a stack of namespace prefix links 
00053    within the context.  An entry is added to the stack at each level where 
00054    an xmlns attribute is detected. */
00055 typedef struct OSXMLNSPfxLinkStack {
00056    OSINT32      count;  /* count of elements in stack */
00057    OSXMLNSPfxLinkStackNode* top;  /* top of stack     */
00058 } OSXMLNSPfxLinkStack;
00059 
00060 /* This structure describes a namespace URI table */
00061 typedef struct OSXMLNSURITable {
00062    OSUINT32     nrows;
00063    const OSUTF8CHAR** data;
00064 } OSXMLNSURITable;
00065 
00066 #ifdef __cplusplus
00067 extern "C" {
00068 #endif
00069 
00080 EXTERNXML OSXMLNamespace* rtXmlNSAddNamespace 
00081 (OSCTXT* pctxt, OSRTDList* pNSAttrs, const OSUTF8CHAR* prefix, 
00082  const OSUTF8CHAR* uri);
00083 
00093 EXTERNXML OSBOOL rtXmlNSEqual (OSXMLNamespace* pNS1, OSXMLNamespace* pNS2);
00094 
00102 EXTERNXML void rtXmlNSFreeAttrList (OSCTXT* pctxt, OSRTDList* pNSAttrs);
00103 
00111 EXTERNXML const OSUTF8CHAR* rtXmlNSGetPrefix 
00112 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00113 
00125 EXTERNXML const OSUTF8CHAR* rtXmlNSGetQName
00126 (OSCTXT* pctxt, OSUTF8CHAR* buf, size_t bufsiz, const OSUTF8CHAR* uri, 
00127  const OSUTF8CHAR* localName);
00128 
00142 EXTERNXML const OSUTF8CHAR* rtXmlNSGetAttrQName
00143 (OSCTXT* pctxt, OSUTF8CHAR* buf, size_t bufsiz, OSXMLNamespace* pNS, 
00144  const OSUTF8CHAR* localName, OSRTDList* pNSAttrs);
00145 
00154 EXTERNXML OSXMLNamespace* rtXmlNSLookupURI 
00155 (OSCTXT* pctxt, const OSUTF8CHAR* uri);
00156 
00165 EXTERNXML OSXMLNamespace* rtXmlNSLookupURIInList 
00166 (OSRTDList* pNSAttrs, const OSUTF8CHAR* uri);
00167 
00176 EXTERNXML OSXMLNamespace* rtXmlNSLookupPrefix
00177 (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00178 
00185 EXTERNXML void rtXmlNSRemoveAll (OSCTXT* pctxt);
00186 
00203 EXTERNXML OSXMLNamespace* rtXmlNSSetNamespace 
00204 (OSCTXT* pctxt, OSRTDList* pNSAttrs, const OSUTF8CHAR* prefix, 
00205  const OSUTF8CHAR* uri, OSBOOL override);
00206 
00216 EXTERNXML const OSUTF8CHAR* rtXmlNSNewPrefix 
00217 (OSCTXT* pctxt, const OSUTF8CHAR* uri, OSRTDList* pNSAttrs);
00218 
00222 EXTERNXML int rtXmlNSAddPrefixLink
00223 (OSCTXT* pctxt, const OSUTF8CHAR* prefix, const OSUTF8CHAR* uri, 
00224  const OSUTF8CHAR* nsTable[], OSUINT32 nsTableRowCount);
00225 
00229 EXTERNXML int rtXmlNSFreeAllPrefixLinks 
00230 (OSCTXT* pctxt, OSXMLNSPfxLinkStackNode* pStackNode);
00231 
00235 EXTERNXML int rtXmlNSFreePrefixLink (OSCTXT* pctxt, OSXMLNSPfxLink* plink);
00236 
00241 EXTERNXML int rtXmlNSGetIndex (OSCTXT* pctxt, const OSUTF8CHAR* prefix);
00242 
00246 EXTERNXML int rtXmlNSPush (OSCTXT* pctxt);
00247 
00251 EXTERNXML int rtXmlNSPop (OSCTXT* pctxt);
00252 
00256 EXTERNXML void rtXmlNSSetURITable 
00257 (OSCTXT* pctxt, const OSUTF8CHAR* data[], OSUINT32 nrows);
00258 
00259 #ifdef __cplusplus
00260 }
00261 #endif
00262 
00263 #endif