• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1      * Summary: Provide Canonical XML and Exclusive XML Canonicalization
2      * Description: the c14n modules provides a
3      *
4      * "Canonical XML" implementation
5      * http://www.w3.org/TR/xml-c14n
6      *
7      * and an
8      *
9      * "Exclusive XML Canonicalization" implementation
10      * http://www.w3.org/TR/xml-exc-c14n
11      *
12      * Copy: See Copyright for the status of this software.
13      *
14      * Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
15
16      /if not defined(XML_C14N_H__)
17      /define XML_C14N_H__
18
19      /include "libxmlrpg/xmlversion"
20
21      /if defined(LIBXML_C14N_ENABLED)
22      /if defined(LIBXML_OUTPUT_ENABLED)
23
24      /include "libxmlrpg/tree"
25      /include "libxmlrpg/xpath"
26
27      * XML Canonicazation
28      * http://www.w3.org/TR/xml-c14n
29      *
30      * Exclusive XML Canonicazation
31      * http://www.w3.org/TR/xml-exc-c14n
32      *
33      * Canonical form of an XML document could be created if and only if
34      *  a) default attributes (if any) are added to all nodes
35      *  b) all character and parsed entity references are resolved
36      * In order to achive this in libxml2 the document MUST be loaded with
37      * following global setings:
38      *
39      *    xmlLoadExtDtdDefaultValue = XML_DETECT_IDS � XML_COMPLETE_ATTRS;
40      *    xmlSubstituteEntitiesDefault(1);
41      *
42      * or corresponding parser context setting:
43      *    xmlParserCtxtPtr ctxt;
44      *
45      *    ...
46      *    ctxt->loadsubset = XML_DETECT_IDS � XML_COMPLETE_ATTRS;
47      *    ctxt->replaceEntities = 1;
48      *    ...
49
50      * xmlC14NMode:
51      *
52      * Predefined values for C14N modes
53
54     d xmlBufferAllocationScheme...
55     d xmlC14NMode     s             10i 0 based(######typedef######)           enum
56     d  XML_C14N_1_0   c                   0                                    Original C14N 1.0
57     d  XML_C14N_EXCLUSIVE_1_0...                                               Exclusive C14N 1.0
58     d                 c                   1
59     d  XML_C14N_1_1   c                   2                                    C14N 1.1 spec
60
61     d xmlC14NDocSaveTo...
62     d                 pr            10i 0 extproc('xmlC14NDocSaveTo')
63     d  doc                                value like(xmlDocPtr)
64     d  nodes                              value like(xmlNodeSetPtr)
65     d  mode                         10i 0 value
66     d  inclusive_ns_prefixes...
67     d                                 *                                        xmlChar *(*)
68     d  with_comments                10i 0 value
69     d  buf                                value like(xmlOutputBufferPtr)
70
71     d xmlC14NDocDumpMemory...
72     d                 pr            10i 0 extproc('xmlC14NDocDumpMemory')
73     d  doc                                value like(xmlDocPtr)
74     d  nodes                              value like(xmlNodeSetPtr)
75     d  mode                         10i 0 value
76     d  inclusive_ns_prefixes...
77     d                                 *                                        xmlChar *(*)
78     d  with_comments                10i 0 value
79     d  doc_txt_ptr                    *                                        xmlChar *(*)
80
81     d xmlC14NDocSave  pr            10i 0 extproc('xmlC14NDocSave')
82     d  doc                                value like(xmlDocPtr)
83     d  nodes                              value like(xmlNodeSetPtr)
84     d  mode                         10i 0 value
85     d  inclusive_ns_prefixes...
86     d                                 *                                        xmlChar *(*)
87     d  with_comments                10i 0 value
88     d  filename                       *   value options(*string)               const char *
89     d  compression                  10i 0 value
90
91      * This is the core C14N function
92
93      * xmlC14NIsVisibleCallback:
94      * @user_data: user data
95      * @node: the curent node
96      * @parent: the parent node
97      *
98      * Signature for a C14N callback on visible nodes
99      *
100      * Returns 1 if the node should be included
101
102     d xmlC14NIsVisibleCallback...
103     d                 s               *   based(######typedef######)
104     d                                     procptr
105
106     d xmlC14NExecute  pr            10i 0 extproc('xmlC14NExecute')
107     d  doc                                value like(xmlDocPtr)
108     d  is_visible_callback...
109     d                                     value like(xmlC14NIsVisibleCallback)
110     d  user_data                      *   value                                void *
111     d  mode                         10i 0 value
112     d  inclusive_ns_prefixes...
113     d                                 *                                        xmlChar *(*)
114     d  with_comments                10i 0 value
115     d  buf                                value like(xmlOutputBufferPtr)
116
117      /endif                                                                    LIBXML_OUTPUT_ENABLD
118      /endif                                                                    LIBXML_C14N_ENABLED
119      /endif                                                                    XML_C14N_H__
120