domAPI.h

00001 /*
00002  * Copyright (c) 2003-2009 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 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 typedef void* OSRTDOMDocPtr;
00042 typedef void* OSRTDOMNodePtr;
00043 typedef void* OSRTDOMAttrPtr;
00044 typedef void* OSRTDOMNsNodePtr;
00045 typedef void* OSRTDOMContCtxtPtr;
00046 typedef void* OSRTDOMAttrCtxtPtr;
00047 
00052 typedef int OSRTDOMError;
00053 
00057 EXTERNDOM void domParserInit ();
00058 
00062 EXTERNDOM void domParserShutdown ();
00063 
00071 EXTERNDOM OSRTDOMError domParseFile (const char* fileSpec, OSRTDOMDocPtr* pXmlDoc);
00072 
00080 EXTERNDOM OSRTDOMError domGetRootElement (OSRTDOMDocPtr xmlDoc, OSRTDOMNodePtr* pNode);
00081 
00089 EXTERNDOM OSRTDOMError domGetDoc (OSRTDOMNodePtr node, OSRTDOMDocPtr* pXmlDoc);
00090 
00095 EXTERNDOM void domFreeDoc (OSRTDOMDocPtr xmlDoc);
00096 
00104 EXTERNDOM OSRTDOMError domGetNext (const OSRTDOMNodePtr curNode,
00105                                    OSRTDOMNodePtr* pNextNode);
00106 
00114 EXTERNDOM OSRTDOMError domGetChild (const OSRTDOMNodePtr curNode,
00115                                     OSRTDOMNodePtr* pChildNode);
00116 
00127 EXTERNDOM OSRTDOMError domGetElementName (const OSRTDOMNodePtr curNode,
00128                                           const OSUTF8CHAR** ppName,
00129                                           const OSUTF8CHAR** ppNsPrefix,
00130                                           const OSUTF8CHAR** ppNsUri);
00131 
00144 EXTERNDOM int domGetNodeContent (OSRTDOMContCtxtPtr* ppCtxt,
00145                                  const OSRTDOMNodePtr curNode,
00146                                  const OSUTF8CHAR** ppValue,
00147                                  size_t* pValueLen,
00148                                  OSBOOL* pCdataProcessed);
00149 
00163 EXTERNDOM OSRTDOMError domGetNodeFirstAttribute (OSRTDOMAttrCtxtPtr* ppCtxt,
00164                                                  const OSRTDOMNodePtr curNode,
00165                                                  OSRTDOMAttrPtr* pTopAttrNode);
00166 
00173 EXTERNDOM int domGetNodeAttributesNum (const OSRTDOMNodePtr curNode);
00174 
00184 EXTERNDOM OSRTDOMError domGetNextAttr (OSRTDOMAttrCtxtPtr* ppCtxt,
00185                                        const OSRTDOMAttrPtr curAttrNode,
00186                                        OSRTDOMAttrPtr* pAttrNode);
00197 EXTERNDOM OSRTDOMError domGetAttrData (const OSRTDOMAttrPtr curAttrNode,
00198                                        const OSUTF8CHAR** ppAttrName,
00199                                        const OSUTF8CHAR** ppAttrValue,
00200                                        const OSUTF8CHAR** ppAttrPrefix,
00201                                        const OSUTF8CHAR** ppAttrUri);
00202 
00203 /* Encode */
00212 EXTERNDOM OSRTDOMError domSaveDoc (OSRTDOMDocPtr xmlDoc,
00213                                    const char* filename);
00214 
00226 EXTERNDOM OSRTDOMError domCreateDocument (OSCTXT* pctxt,
00227                                           OSRTDOMDocPtr* pXmlDoc,
00228                                           const OSUTF8CHAR* pNodeName,
00229                                           OSXMLNamespace* pNS, 
00230                                           OSRTDList* pNSAttrs);
00231 
00243 EXTERNDOM OSRTDOMError domCreateChild (OSCTXT* pctxt,
00244                                        OSRTDOMNodePtr parentNode,
00245                                        const OSUTF8CHAR* pNodeName,
00246                                        OSXMLNamespace* pNS, 
00247                                        OSRTDList* pNSAttrs,
00248                                        OSRTDOMNodePtr* pNewNode);
00249 
00263 EXTERNDOM OSRTDOMError domAddAttribute (OSCTXT* pctxt,
00264                                         OSRTDOMNodePtr node,
00265                                         const OSUTF8CHAR* pAttrName,
00266                                         const OSUTF8CHAR* pAttrValue,
00267                                         OSXMLNamespace* pNS, 
00268                                         OSRTDList* pNSAttrs);
00269 
00278 EXTERNDOM OSRTDOMError domAddContent (OSRTDOMNodePtr node,
00279                                       const OSUTF8CHAR* pContent,
00280                                       size_t contentLen);
00281 
00291 EXTERNDOM OSRTDOMError domAddCdata (OSRTDOMNodePtr node,
00292                                     const OSUTF8CHAR* pContent,
00293                                     size_t contentLen);
00294 
00295 EXTERNDOM OSBOOL domIsContent (OSRTDOMNodePtr node);
00296 
00297 #ifdef __cplusplus
00298 }
00299 #endif
00300 
00303 #endif /* __DOMAPI_H */
00304