Home > Support > Documentation

domAPI.h

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  *****************************************************************************/
00024 
00025 #ifndef __DOMAPI_H
00026 #define __DOMAPI_H
00027 
00028 #include "rtxsrc/rtxCommon.h"
00029 #include "rtdomsrc/rtxDomDefs.h"
00030 #include "rtxmlsrc/osrtxml.h"
00031 #include "rtxmlsrc/rtXmlNamespace.h"
00032 
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00038 typedef void* OSRTDOMDocPtr;
00039 typedef void* OSRTDOMNodePtr;
00040 typedef void* OSRTDOMAttrPtr;
00041 typedef void* OSRTDOMNsNodePtr;
00042 typedef void* OSRTDOMContCtxtPtr;
00043 typedef void* OSRTDOMAttrCtxtPtr;
00044 
00049 typedef int OSRTDOMError;
00050 
00054 EXTERNDOM void domParserInit ();
00055 
00059 EXTERNDOM void domParserShutdown ();
00060 
00068 EXTERNDOM OSRTDOMError domParseFile (const char* fileSpec, OSRTDOMDocPtr* pXmlDoc);
00069 
00077 EXTERNDOM OSRTDOMError domGetRootElement (OSRTDOMDocPtr xmlDoc, OSRTDOMNodePtr* pNode);
00078 
00086 EXTERNDOM OSRTDOMError domGetDoc (OSRTDOMNodePtr node, OSRTDOMDocPtr* pXmlDoc);
00087 
00092 EXTERNDOM void domFreeDoc (OSRTDOMDocPtr xmlDoc);
00093 
00102 EXTERNDOM OSRTDOMError domGetNextElement (const OSRTDOMNodePtr curNode,
00103                                           OSRTDOMNodePtr* pNextNode);
00104 
00113 EXTERNDOM OSRTDOMError domGetChildElement (const OSRTDOMNodePtr curNode,
00114                                            OSRTDOMNodePtr* pChildNode);
00115 
00126 EXTERNDOM OSRTDOMError domGetElementName (const OSRTDOMNodePtr curNode,
00127                                           const OSUTF8CHAR** ppName,
00128                                           const OSUTF8CHAR** ppNsPrefix,
00129                                           const OSUTF8CHAR** ppNsUri);
00130 
00149 EXTERNDOM int domGetNodeContentFirst (OSRTDOMContCtxtPtr* ppCtxt,
00150                                       const OSRTDOMNodePtr curNode,
00151                                       const OSUTF8CHAR** ppValue,
00152                                       size_t* pValueLen,
00153                                       OSBOOL* pCdataProcessed);
00154 
00169 EXTERNDOM int domGetNodeContentNext (OSRTDOMContCtxtPtr* ppCtxt,
00170                                      const OSRTDOMNodePtr curNode,
00171                                      const OSUTF8CHAR** ppValue,
00172                                      size_t* pValueLen,
00173                                      OSBOOL* pCdataProcessed);
00174 
00188 EXTERNDOM OSRTDOMError domGetNodeFirstAttribute (OSRTDOMAttrCtxtPtr* ppCtxt,
00189                                                  const OSRTDOMNodePtr curNode,
00190                                                  OSRTDOMAttrPtr* pTopAttrNode);
00191 
00198 EXTERNDOM int domGetNodeAttributesNum (const OSRTDOMNodePtr curNode);
00199 
00209 EXTERNDOM OSRTDOMError domGetNextAttr (OSRTDOMAttrCtxtPtr* ppCtxt,
00210                                        const OSRTDOMAttrPtr curAttrNode,
00211                                        OSRTDOMAttrPtr* pAttrNode);
00222 EXTERNDOM OSRTDOMError domGetAttrData (const OSRTDOMAttrPtr curAttrNode,
00223                                        const OSUTF8CHAR** ppAttrName,
00224                                        const OSUTF8CHAR** ppAttrValue,
00225                                        const OSUTF8CHAR** ppAttrPrefix,
00226                                        const OSUTF8CHAR** ppAttrUri);
00227 
00228 /* Encode */
00237 EXTERNDOM OSRTDOMError domSaveDoc (OSRTDOMDocPtr xmlDoc,
00238                                    const char* filename);
00239 
00251 EXTERNDOM OSRTDOMError domCreateDocument (OSCTXT* pctxt,
00252                                           OSRTDOMDocPtr* pXmlDoc,
00253                                           const OSUTF8CHAR* pNodeName,
00254                                           OSXMLNamespace* pNS, 
00255                                           OSRTDList* pNSAttrs);
00256 
00268 EXTERNDOM OSRTDOMError domCreateChild (OSCTXT* pctxt,
00269                                        OSRTDOMNodePtr parentNode,
00270                                        const OSUTF8CHAR* pNodeName,
00271                                        OSXMLNamespace* pNS, 
00272                                        OSRTDList* pNSAttrs,
00273                                        OSRTDOMNodePtr* pNewNode);
00274 
00288 EXTERNDOM OSRTDOMError domAddAttribute (OSCTXT* pctxt,
00289                                         OSRTDOMNodePtr node,
00290                                         const OSUTF8CHAR* pAttrName,
00291                                         const OSUTF8CHAR* pAttrValue,
00292                                         OSXMLNamespace* pNS, 
00293                                         OSRTDList* pNSAttrs);
00294 
00303 EXTERNDOM OSRTDOMError domAddContent (OSRTDOMNodePtr node,
00304                                       const OSUTF8CHAR* pContent,
00305                                       size_t contentLen);
00306 
00316 EXTERNDOM OSRTDOMError domAddCdata (OSRTDOMNodePtr node,
00317                                     const OSUTF8CHAR* pContent,
00318                                     size_t contentLen);
00319 
00320 #ifdef __cplusplus
00321 }
00322 #endif
00323 
00324 #endif /* __DOMAPI_H */