Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

c14n.h

Go to the documentation of this file.
00001 /*
00002  * "Canonical XML" implementation 
00003  * http://www.w3.org/TR/xml-c14n
00004  * 
00005  * "Exclusive XML Canonicalization" implementation
00006  * http://www.w3.org/TR/xml-exc-c14n
00007  
00008  * See Copyright for the status of this software.
00009  * 
00010  * Author: Aleksey Sanin <aleksey@aleksey.com>
00011  */
00012 #ifndef __XML_C14N_H__
00013 #define __XML_C14N_H__    
00014 #ifdef LIBXML_OUTPUT_ENABLED
00015 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif /* __cplusplus */ 
00019 
00020 #include <libxml/xmlversion.h>
00021 #include <libxml/tree.h>
00022 #include <libxml/xpath.h> 
00023 
00024 /*
00025  * XML Canonicazation
00026  * http://www.w3.org/TR/xml-c14n
00027  *
00028  * Exclusive XML Canonicazation
00029  * http://www.w3.org/TR/xml-exc-c14n
00030  *
00031  * Canonical form of an XML document could be created if and only if
00032  *  a) default attributes (if any) are added to all nodes
00033  *  b) all character and parsed entity references are resolved
00034  * In order to achive this in libxml2 the document MUST be loaded with 
00035  * following global setings:
00036  *    
00037  *    xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
00038  *    xmlSubstituteEntitiesDefault(1);
00039  *
00040  * or corresponding parser context setting:
00041  *    xmlParserCtxtPtr ctxt;
00042  *    
00043  *    ... 
00044  *    ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
00045  *    ctxt->replaceEntities = 1;
00046  *    ...
00047  */
00048 
00049 
00050 XMLPUBFUN int XMLCALL           
00051                 xmlC14NDocSaveTo        (xmlDocPtr doc,
00052                                          xmlNodeSetPtr nodes,
00053                                          int exclusive,
00054                                          xmlChar **inclusive_ns_prefixes,
00055                                          int with_comments, 
00056                                          xmlOutputBufferPtr buf);
00057 
00058 XMLPUBFUN int XMLCALL
00059                 xmlC14NDocDumpMemory    (xmlDocPtr doc,
00060                                          xmlNodeSetPtr nodes,
00061                                          int exclusive,
00062                                          xmlChar **inclusive_ns_prefixes,
00063                                          int with_comments, 
00064                                          xmlChar **doc_txt_ptr);
00065 
00066 XMLPUBFUN int XMLCALL
00067                 xmlC14NDocSave          (xmlDocPtr doc,
00068                                          xmlNodeSetPtr nodes,
00069                                          int exclusive,
00070                                          xmlChar **inclusive_ns_prefixes,
00071                                          int with_comments, 
00072                                          const char* filename,
00073                                          int compression);
00074 
00075 
00079 typedef int (*xmlC14NIsVisibleCallback) (void* user_data, 
00080                                          xmlNodePtr node,
00081                                          xmlNodePtr parent);
00082 
00083 XMLPUBFUN int XMLCALL
00084                 xmlC14NExecute          (xmlDocPtr doc,
00085                                          xmlC14NIsVisibleCallback is_visible_callback,
00086                                          void* user_data,                                
00087                                          int exclusive,
00088                                          xmlChar **inclusive_ns_prefixes,
00089                                          int with_comments, 
00090                                          xmlOutputBufferPtr buf);
00091 
00092 #ifdef __cplusplus
00093 }
00094 #endif /* __cplusplus */
00095 
00096 #endif /* LIBXML_OUTPUT_ENABLED */
00097 #endif /* __XML_C14N_H__ */
00098 
00099 

Generated on Wed Mar 16 00:10:26 2005 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1