blob: 4bc441c4850443f0ea18c7c315ea64127f4fb55e [file] [log] [blame]
Daniel Veillard044fc6b2002-03-04 17:09:44 +00001/*
Daniel Veillardbe586972003-11-18 20:56:51 +00002 * Summary: Provide Canonical XML and Exclusive XML Canonicalization
3 * Description: the c14n modules provides a
4 *
Daniel Veillard044fc6b2002-03-04 17:09:44 +00005 * "Canonical XML" implementation
6 * http://www.w3.org/TR/xml-c14n
7 *
Daniel Veillardbe586972003-11-18 20:56:51 +00008 * and an
9 *
Daniel Veillard044fc6b2002-03-04 17:09:44 +000010 * "Exclusive XML Canonicalization" implementation
11 * http://www.w3.org/TR/xml-exc-c14n
12
Daniel Veillardbe586972003-11-18 20:56:51 +000013 * Copy: See Copyright for the status of this software.
Daniel Veillard044fc6b2002-03-04 17:09:44 +000014 *
15 * Author: Aleksey Sanin <aleksey@aleksey.com>
16 */
17#ifndef __XML_C14N_H__
18#define __XML_C14N_H__
Daniel Veillarda9cce9c2003-09-29 13:20:24 +000019#ifdef LIBXML_OUTPUT_ENABLED
Daniel Veillard044fc6b2002-03-04 17:09:44 +000020
21#ifdef __cplusplus
22extern "C" {
23#endif /* __cplusplus */
24
Igor Zlatkovic76874e42003-08-25 09:05:12 +000025#include <libxml/xmlversion.h>
Daniel Veillard044fc6b2002-03-04 17:09:44 +000026#include <libxml/tree.h>
27#include <libxml/xpath.h>
28
29/*
30 * XML Canonicazation
31 * http://www.w3.org/TR/xml-c14n
32 *
33 * Exclusive XML Canonicazation
34 * http://www.w3.org/TR/xml-exc-c14n
35 *
36 * Canonical form of an XML document could be created if and only if
37 * a) default attributes (if any) are added to all nodes
38 * b) all character and parsed entity references are resolved
39 * In order to achive this in libxml2 the document MUST be loaded with
40 * following global setings:
41 *
42 * xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
43 * xmlSubstituteEntitiesDefault(1);
44 *
45 * or corresponding parser context setting:
46 * xmlParserCtxtPtr ctxt;
47 *
48 * ...
49 * ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
50 * ctxt->replaceEntities = 1;
51 * ...
52 */
Aleksey Sanin2c135a12002-08-01 06:31:50 +000053
54
Igor Zlatkovic76874e42003-08-25 09:05:12 +000055XMLPUBFUN int XMLCALL
56 xmlC14NDocSaveTo (xmlDocPtr doc,
Daniel Veillard044fc6b2002-03-04 17:09:44 +000057 xmlNodeSetPtr nodes,
58 int exclusive,
59 xmlChar **inclusive_ns_prefixes,
60 int with_comments,
61 xmlOutputBufferPtr buf);
62
Igor Zlatkovic76874e42003-08-25 09:05:12 +000063XMLPUBFUN int XMLCALL
64 xmlC14NDocDumpMemory (xmlDocPtr doc,
Daniel Veillard044fc6b2002-03-04 17:09:44 +000065 xmlNodeSetPtr nodes,
66 int exclusive,
67 xmlChar **inclusive_ns_prefixes,
68 int with_comments,
69 xmlChar **doc_txt_ptr);
70
Igor Zlatkovic76874e42003-08-25 09:05:12 +000071XMLPUBFUN int XMLCALL
72 xmlC14NDocSave (xmlDocPtr doc,
Daniel Veillard044fc6b2002-03-04 17:09:44 +000073 xmlNodeSetPtr nodes,
74 int exclusive,
75 xmlChar **inclusive_ns_prefixes,
76 int with_comments,
77 const char* filename,
78 int compression);
79
80
Aleksey Sanin2c135a12002-08-01 06:31:50 +000081/**
82 * This is the core C14N function
83 */
84typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
85 xmlNodePtr node,
86 xmlNodePtr parent);
87
Igor Zlatkovic76874e42003-08-25 09:05:12 +000088XMLPUBFUN int XMLCALL
89 xmlC14NExecute (xmlDocPtr doc,
Aleksey Sanin2c135a12002-08-01 06:31:50 +000090 xmlC14NIsVisibleCallback is_visible_callback,
91 void* user_data,
92 int exclusive,
93 xmlChar **inclusive_ns_prefixes,
94 int with_comments,
95 xmlOutputBufferPtr buf);
96
Daniel Veillard044fc6b2002-03-04 17:09:44 +000097#ifdef __cplusplus
98}
99#endif /* __cplusplus */
100
Daniel Veillarda9cce9c2003-09-29 13:20:24 +0000101#endif /* LIBXML_OUTPUT_ENABLED */
Daniel Veillard044fc6b2002-03-04 17:09:44 +0000102#endif /* __XML_C14N_H__ */
103