c14n.h

00001 /*
00002 
00003  * Summary: Provide Canonical XML and Exclusive XML Canonicalization
00004 
00005  * Description: the c14n modules provides a
00006 
00007  *
00008 
00009  * "Canonical XML" implementation 
00010 
00011  * http://www.w3.org/TR/xml-c14n
00012 
00013  * 
00014 
00015  * and an
00016 
00017  *
00018 
00019  * "Exclusive XML Canonicalization" implementation
00020 
00021  * http://www.w3.org/TR/xml-exc-c14n
00022 
00023  
00024 
00025  * Copy: See Copyright for the status of this software.
00026 
00027  * 
00028 
00029  * Author: Aleksey Sanin <aleksey@aleksey.com>
00030 
00031  */
00032 
00033 #ifndef __XML_C14N_H__
00034 
00035 #define __XML_C14N_H__    
00036 
00037 #ifdef LIBXML_C14N_ENABLED
00038 
00039 #ifdef LIBXML_OUTPUT_ENABLED
00040 
00041 
00042 
00043 #ifdef __cplusplus
00044 
00045 extern "C" {
00046 
00047 #endif /* __cplusplus */ 
00048 
00049 
00050 
00051 #include <libxml/xmlversion.h>
00052 
00053 #include <libxml/tree.h>
00054 
00055 #include <libxml/xpath.h> 
00056 
00057 
00058 
00059 /*
00060 
00061  * XML Canonicazation
00062 
00063  * http://www.w3.org/TR/xml-c14n
00064 
00065  *
00066 
00067  * Exclusive XML Canonicazation
00068 
00069  * http://www.w3.org/TR/xml-exc-c14n
00070 
00071  *
00072 
00073  * Canonical form of an XML document could be created if and only if
00074 
00075  *  a) default attributes (if any) are added to all nodes
00076 
00077  *  b) all character and parsed entity references are resolved
00078 
00079  * In order to achive this in libxml2 the document MUST be loaded with 
00080 
00081  * following global setings:
00082 
00083  *    
00084 
00085  *    xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
00086 
00087  *    xmlSubstituteEntitiesDefault(1);
00088 
00089  *
00090 
00091  * or corresponding parser context setting:
00092 
00093  *    xmlParserCtxtPtr ctxt;
00094 
00095  *    
00096 
00097  *    ... 
00098 
00099  *    ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
00100 
00101  *    ctxt->replaceEntities = 1;
00102 
00103  *    ...
00104 
00105  */
00106 
00107 
00108 
00109 
00110 
00111 XMLPUBFUN int XMLCALL           
00112 
00113                 xmlC14NDocSaveTo        (xmlDocPtr doc,
00114 
00115                                          xmlNodeSetPtr nodes,
00116 
00117                                          int exclusive,
00118 
00119                                          xmlChar **inclusive_ns_prefixes,
00120 
00121                                          int with_comments, 
00122 
00123                                          xmlOutputBufferPtr buf);
00124 
00125 
00126 
00127 XMLPUBFUN int XMLCALL
00128 
00129                 xmlC14NDocDumpMemory    (xmlDocPtr doc,
00130 
00131                                          xmlNodeSetPtr nodes,
00132 
00133                                          int exclusive,
00134 
00135                                          xmlChar **inclusive_ns_prefixes,
00136 
00137                                          int with_comments, 
00138 
00139                                          xmlChar **doc_txt_ptr);
00140 
00141 
00142 
00143 XMLPUBFUN int XMLCALL
00144 
00145                 xmlC14NDocSave          (xmlDocPtr doc,
00146 
00147                                          xmlNodeSetPtr nodes,
00148 
00149                                          int exclusive,
00150 
00151                                          xmlChar **inclusive_ns_prefixes,
00152 
00153                                          int with_comments, 
00154 
00155                                          const char* filename,
00156 
00157                                          int compression);
00158 
00159 
00160 
00161 
00162 
00169 typedef int (*xmlC14NIsVisibleCallback) (void* user_data, 
00170 
00171                                          xmlNodePtr node,
00172 
00173                                          xmlNodePtr parent);
00174 
00175 
00176 
00177 XMLPUBFUN int XMLCALL
00178 
00179                 xmlC14NExecute          (xmlDocPtr doc,
00180 
00181                                          xmlC14NIsVisibleCallback is_visible_callback,
00182 
00183                                          void* user_data,                                
00184 
00185                                          int exclusive,
00186 
00187                                          xmlChar **inclusive_ns_prefixes,
00188 
00189                                          int with_comments, 
00190 
00191                                          xmlOutputBufferPtr buf);
00192 
00193 
00194 
00195 #ifdef __cplusplus
00196 
00197 }
00198 
00199 #endif /* __cplusplus */
00200 
00201 
00202 
00203 #endif /* LIBXML_OUTPUT_ENABLED */
00204 
00205 #endif /* LIBXML_C14N_ENABLED */
00206 
00207 #endif /* __XML_C14N_H__ */
00208 
00209 
00210 

Generated on Wed Jul 26 13:30:46 2006 for XSB by  doxygen 1.4.5