2 * "Canonical XML" implementation
3 * http://www.w3.org/TR/xml-c14n
5 * "Exclusive XML Canonicalization" implementation
6 * http://www.w3.org/TR/xml-exc-c14n
8 * See Copyright for the status of this software.
10 * Author: Aleksey Sanin <aleksey@aleksey.com>
12 #ifndef __XML_C14N_H__
13 #define __XML_C14N_H__
17 #endif /* __cplusplus */
19 #include <libxml/tree.h>
20 #include <libxml/xpath.h>
24 * http://www.w3.org/TR/xml-c14n
26 * Exclusive XML Canonicazation
27 * http://www.w3.org/TR/xml-exc-c14n
29 * Canonical form of an XML document could be created if and only if
30 * a) default attributes (if any) are added to all nodes
31 * b) all character and parsed entity references are resolved
32 * In order to achive this in libxml2 the document MUST be loaded with
33 * following global setings:
35 * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
36 * xmlSubstituteEntitiesDefault(1);
38 * or corresponding parser context setting:
39 * xmlParserCtxtPtr ctxt;
42 * ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
43 * ctxt->replaceEntities = 1;
48 int xmlC14NDocSaveTo (xmlDocPtr doc,
51 xmlChar **inclusive_ns_prefixes,
53 xmlOutputBufferPtr buf);
55 int xmlC14NDocDumpMemory (xmlDocPtr doc,
58 xmlChar **inclusive_ns_prefixes,
60 xmlChar **doc_txt_ptr);
62 int xmlC14NDocSave (xmlDocPtr doc,
65 xmlChar **inclusive_ns_prefixes,
72 * This is the core C14N function
74 typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
78 int xmlC14NExecute (xmlDocPtr doc,
79 xmlC14NIsVisibleCallback is_visible_callback,
82 xmlChar **inclusive_ns_prefixes,
84 xmlOutputBufferPtr buf);
88 #endif /* __cplusplus */
90 #endif /* __XML_C14N_H__ */