• 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/xmlTypesC"
25      /include "libxmlrpg/tree"
26      /include "libxmlrpg/xpath"
27
28      * XML Canonicazation
29      * http://www.w3.org/TR/xml-c14n
30      *
31      * Exclusive XML Canonicazation
32      * http://www.w3.org/TR/xml-exc-c14n
33      *
34      * Canonical form of an XML document could be created if and only if
35      *  a) default attributes (if any) are added to all nodes
36      *  b) all character and parsed entity references are resolved
37      * In order to achive this in libxml2 the document MUST be loaded with
38      * following global setings:
39      *
40      *    xmlLoadExtDtdDefaultValue = XML_DETECT_IDS � XML_COMPLETE_ATTRS;
41      *    xmlSubstituteEntitiesDefault(1);
42      *
43      * or corresponding parser context setting:
44      *    xmlParserCtxtPtr ctxt;
45      *
46      *    ...
47      *    ctxt->loadsubset = XML_DETECT_IDS � XML_COMPLETE_ATTRS;
48      *    ctxt->replaceEntities = 1;
49      *    ...
50
51      * xmlC14NMode:
52      *
53      * Predefined values for C14N modes
54
55     d xmlBufferAllocationScheme...
56     d xmlC14NMode     s                   based(######typedef######)
57     d                                     like(xmlCenum)
58     d  XML_C14N_1_0   c                   0                                    Original C14N 1.0
59     d  XML_C14N_EXCLUSIVE_1_0...                                               Exclusive C14N 1.0
60     d                 c                   1
61     d  XML_C14N_1_1   c                   2                                    C14N 1.1 spec
62
63     d xmlC14NDocSaveTo...
64     d                 pr                  extproc('xmlC14NDocSaveTo')
65     d                                     like(xmlCint)
66     d  doc                                value like(xmlDocPtr)
67     d  nodes                              value like(xmlNodeSetPtr)
68     d  mode                               value like(xmlCint)
69     d  inclusive_ns_prefixes...
70     d                                 *   options(*omit)                       xmlChar *(*)
71     d  with_comments                      value like(xmlCint)
72     d  buf                                value like(xmlOutputBufferPtr)
73
74     d xmlC14NDocDumpMemory...
75     d                 pr                  extproc('xmlC14NDocDumpMemory')
76     d                                     like(xmlCint)
77     d  doc                                value like(xmlDocPtr)
78     d  nodes                              value like(xmlNodeSetPtr)
79     d  mode                               value like(xmlCint)
80     d  inclusive_ns_prefixes...
81     d                                 *   options(*omit)                       xmlChar *(*)
82     d  with_comments                      value like(xmlCint)
83     d  doc_txt_ptr                    *                                        xmlChar *(*)
84
85     d xmlC14NDocSave  pr                  extproc('xmlC14NDocSave')
86     d                                     like(xmlCint)
87     d  doc                                value like(xmlDocPtr)
88     d  nodes                              value like(xmlNodeSetPtr)
89     d  mode                               value like(xmlCint)
90     d  inclusive_ns_prefixes...
91     d                                 *   options(*omit)                       xmlChar *(*)
92     d  with_comments                      value like(xmlCint)
93     d  filename                       *   value options(*string)               const char *
94     d  compression                        value like(xmlCint)
95
96      * This is the core C14N function
97
98      * xmlC14NIsVisibleCallback:
99      * @user_data: user data
100      * @node: the curent node
101      * @parent: the parent node
102      *
103      * Signature for a C14N callback on visible nodes
104      *
105      * Returns 1 if the node should be included
106
107     d xmlC14NIsVisibleCallback...
108     d                 s               *   based(######typedef######)
109     d                                     procptr
110
111     d xmlC14NExecute  pr                  extproc('xmlC14NExecute')
112     d                                     like(xmlCint)
113     d  doc                                value like(xmlDocPtr)
114     d  is_visible_callback...
115     d                                     value like(xmlC14NIsVisibleCallback)
116     d  user_data                      *   value                                void *
117     d  mode                               value like(xmlCint)
118     d  inclusive_ns_prefixes...
119     d                                 *   options(*omit)                       xmlChar *(*)
120     d  with_comments                      value like(xmlCint)
121     d  buf                                value like(xmlOutputBufferPtr)
122
123      /endif                                                                    LIBXML_OUTPUT_ENABLD
124      /endif                                                                    LIBXML_C14N_ENABLED
125      /endif                                                                    XML_C14N_H__
126