blob: 8a78929f2f0adfc1e11bbaff5fd65dc662429d1f [file] [log] [blame]
Daniel Veillard044fc6b2002-03-04 17:09:44 +00001/*
2 * "Canonical XML" implementation
3 * http://www.w3.org/TR/xml-c14n
4 *
5 * "Exclusive XML Canonicalization" implementation
6 * http://www.w3.org/TR/xml-exc-c14n
7
8 * See Copyright for the status of this software.
9 *
10 * Author: Aleksey Sanin <aleksey@aleksey.com>
11 */
12#ifndef __XML_C14N_H__
13#define __XML_C14N_H__
Daniel Veillarda9cce9c2003-09-29 13:20:24 +000014#ifdef LIBXML_OUTPUT_ENABLED
Daniel Veillard044fc6b2002-03-04 17:09:44 +000015
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
Igor Zlatkovic76874e42003-08-25 09:05:12 +000020#include <libxml/xmlversion.h>
Daniel Veillard044fc6b2002-03-04 17:09:44 +000021#include <libxml/tree.h>
22#include <libxml/xpath.h>
23
24/*
25 * XML Canonicazation
26 * http://www.w3.org/TR/xml-c14n
27 *
28 * Exclusive XML Canonicazation
29 * http://www.w3.org/TR/xml-exc-c14n
30 *
31 * Canonical form of an XML document could be created if and only if
32 * a) default attributes (if any) are added to all nodes
33 * b) all character and parsed entity references are resolved
34 * In order to achive this in libxml2 the document MUST be loaded with
35 * following global setings:
36 *
37 * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
38 * xmlSubstituteEntitiesDefault(1);
39 *
40 * or corresponding parser context setting:
41 * xmlParserCtxtPtr ctxt;
42 *
43 * ...
44 * ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
45 * ctxt->replaceEntities = 1;
46 * ...
47 */
Aleksey Sanin2c135a12002-08-01 06:31:50 +000048
49
Igor Zlatkovic76874e42003-08-25 09:05:12 +000050XMLPUBFUN int XMLCALL
51 xmlC14NDocSaveTo (xmlDocPtr doc,
Daniel Veillard044fc6b2002-03-04 17:09:44 +000052 xmlNodeSetPtr nodes,
53 int exclusive,
54 xmlChar **inclusive_ns_prefixes,
55 int with_comments,
56 xmlOutputBufferPtr buf);
57
Igor Zlatkovic76874e42003-08-25 09:05:12 +000058XMLPUBFUN int XMLCALL
59 xmlC14NDocDumpMemory (xmlDocPtr doc,
Daniel Veillard044fc6b2002-03-04 17:09:44 +000060 xmlNodeSetPtr nodes,
61 int exclusive,
62 xmlChar **inclusive_ns_prefixes,
63 int with_comments,
64 xmlChar **doc_txt_ptr);
65
Igor Zlatkovic76874e42003-08-25 09:05:12 +000066XMLPUBFUN int XMLCALL
67 xmlC14NDocSave (xmlDocPtr doc,
Daniel Veillard044fc6b2002-03-04 17:09:44 +000068 xmlNodeSetPtr nodes,
69 int exclusive,
70 xmlChar **inclusive_ns_prefixes,
71 int with_comments,
72 const char* filename,
73 int compression);
74
75
Aleksey Sanin2c135a12002-08-01 06:31:50 +000076/**
77 * This is the core C14N function
78 */
79typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
80 xmlNodePtr node,
81 xmlNodePtr parent);
82
Igor Zlatkovic76874e42003-08-25 09:05:12 +000083XMLPUBFUN int XMLCALL
84 xmlC14NExecute (xmlDocPtr doc,
Aleksey Sanin2c135a12002-08-01 06:31:50 +000085 xmlC14NIsVisibleCallback is_visible_callback,
86 void* user_data,
87 int exclusive,
88 xmlChar **inclusive_ns_prefixes,
89 int with_comments,
90 xmlOutputBufferPtr buf);
91
Daniel Veillard044fc6b2002-03-04 17:09:44 +000092#ifdef __cplusplus
93}
94#endif /* __cplusplus */
95
Daniel Veillarda9cce9c2003-09-29 13:20:24 +000096#endif /* LIBXML_OUTPUT_ENABLED */
Daniel Veillard044fc6b2002-03-04 17:09:44 +000097#endif /* __XML_C14N_H__ */
98