1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>c14n</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css">
2 .synopsis, .classsynopsis {
4 border: solid 1px #aaaaaa;
9 border: solid 1px #aaaaff;
18 border: solid 1px #ffaaaa;
25 .navigation a:visited {
31 </style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual"><link rel="up" href="libxml-lib.html" title="Libxml Library Reference"><link rel="previous" href="libxml-catalog.html" title="catalog"><link rel="next" href="libxml-threads.html" title="threads"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-catalog.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="libxml-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">Gnome XML Library Reference Manual</th><td><a accesskey="n" href="libxml-threads.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td></tr></table><div class="refentry" lang="en"><a name="libxml-c14n"></a><div class="titlepage"></div><div class="refnamediv"><h2>c14n</h2><p>c14n — </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
35 int <a href="libxml-c14n.html#xmlC14NDocSaveTo">xmlC14NDocSaveTo</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
36 <a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> nodes,
38 <a href="libxml-tree.html#xmlChar">xmlChar</a> **inclusive_ns_prefixes,
40 <a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf);
41 int <a href="libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
42 <a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> nodes,
44 <a href="libxml-tree.html#xmlChar">xmlChar</a> **inclusive_ns_prefixes,
46 <a href="libxml-tree.html#xmlChar">xmlChar</a> **doc_txt_ptr);
47 int <a href="libxml-c14n.html#xmlC14NDocSave">xmlC14NDocSave</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
48 <a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> nodes,
50 <a href="libxml-tree.html#xmlChar">xmlChar</a> **inclusive_ns_prefixes,
54 int (<a href="libxml-c14n.html#xmlC14NIsVisibleCallback">*xmlC14NIsVisibleCallback</a>) (void *user_data,
55 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node,
56 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> parent);
57 int <a href="libxml-c14n.html#xmlC14NExecute">xmlC14NExecute</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
58 <a href="libxml-c14n.html#xmlC14NIsVisibleCallback">xmlC14NIsVisibleCallback</a> is_visible_callback,
61 <a href="libxml-tree.html#xmlChar">xmlChar</a> **inclusive_ns_prefixes,
63 <a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf);
64 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
66 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="xmlC14NDocSaveTo"></a>xmlC14NDocSaveTo ()</h3><pre class="programlisting">int xmlC14NDocSaveTo (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
67 <a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> nodes,
69 <a href="libxml-tree.html#xmlChar">xmlChar</a> **inclusive_ns_prefixes,
71 <a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf);</pre><p>
72 Dumps the canonized image of given XML document into the provided buffer.
73 For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or
74 "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)</p><p>
76 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>doc</tt></i> :</span></td><td> the XML document for canonization
77 </td></tr><tr><td><span class="term"><i><tt>nodes</tt></i> :</span></td><td> the nodes set to be included in the canonized image
78 or NULL if all document nodes should be included
79 </td></tr><tr><td><span class="term"><i><tt>exclusive</tt></i> :</span></td><td> the exclusive flag (0 - non-exclusive canonicalization;
80 otherwise - exclusive canonicalization)
81 </td></tr><tr><td><span class="term"><i><tt>inclusive_ns_prefixes</tt></i> :</span></td><td> the list of inclusive namespace prefixes
82 ended with a NULL or NULL if there is no
83 inclusive namespaces (only for exclusive
84 canonicalization, ignored otherwise)
85 </td></tr><tr><td><span class="term"><i><tt>with_comments</tt></i> :</span></td><td> include comments in the result (!=0) or not (==0)
86 </td></tr><tr><td><span class="term"><i><tt>buf</tt></i> :</span></td><td> the output buffer to store canonical XML; this
87 buffer MUST have encoder==NULL because C14N requires
89 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>non-negative value on success or a negative value on fail
90 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlC14NDocDumpMemory"></a>xmlC14NDocDumpMemory ()</h3><pre class="programlisting">int xmlC14NDocDumpMemory (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
91 <a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> nodes,
93 <a href="libxml-tree.html#xmlChar">xmlChar</a> **inclusive_ns_prefixes,
95 <a href="libxml-tree.html#xmlChar">xmlChar</a> **doc_txt_ptr);</pre><p>
96 Dumps the canonized image of given XML document into memory.
97 For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or
98 "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)</p><p>
100 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>doc</tt></i> :</span></td><td> the XML document for canonization
101 </td></tr><tr><td><span class="term"><i><tt>nodes</tt></i> :</span></td><td> the nodes set to be included in the canonized image
102 or NULL if all document nodes should be included
103 </td></tr><tr><td><span class="term"><i><tt>exclusive</tt></i> :</span></td><td> the exclusive flag (0 - non-exclusive canonicalization;
104 otherwise - exclusive canonicalization)
105 </td></tr><tr><td><span class="term"><i><tt>inclusive_ns_prefixes</tt></i> :</span></td><td> the list of inclusive namespace prefixes
106 ended with a NULL or NULL if there is no
107 inclusive namespaces (only for exclusive
108 canonicalization, ignored otherwise)
109 </td></tr><tr><td><span class="term"><i><tt>with_comments</tt></i> :</span></td><td> include comments in the result (!=0) or not (==0)
110 </td></tr><tr><td><span class="term"><i><tt>doc_txt_ptr</tt></i> :</span></td><td> the memory pointer for allocated canonical XML text;
111 the caller of this functions is responsible for calling
112 <a href="libxml-globals.html#xmlFree">xmlFree</a>() to free allocated memory
113 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number of bytes written on success or a negative value on fail
114 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlC14NDocSave"></a>xmlC14NDocSave ()</h3><pre class="programlisting">int xmlC14NDocSave (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
115 <a href="libxml-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> nodes,
117 <a href="libxml-tree.html#xmlChar">xmlChar</a> **inclusive_ns_prefixes,
119 const char *filename,
120 int compression);</pre><p>
121 Dumps the canonized image of given XML document into the file.
122 For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or
123 "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)</p><p>
125 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>doc</tt></i> :</span></td><td> the XML document for canonization
126 </td></tr><tr><td><span class="term"><i><tt>nodes</tt></i> :</span></td><td> the nodes set to be included in the canonized image
127 or NULL if all document nodes should be included
128 </td></tr><tr><td><span class="term"><i><tt>exclusive</tt></i> :</span></td><td> the exclusive flag (0 - non-exclusive canonicalization;
129 otherwise - exclusive canonicalization)
130 </td></tr><tr><td><span class="term"><i><tt>inclusive_ns_prefixes</tt></i> :</span></td><td> the list of inclusive namespace prefixes
131 ended with a NULL or NULL if there is no
132 inclusive namespaces (only for exclusive
133 canonicalization, ignored otherwise)
134 </td></tr><tr><td><span class="term"><i><tt>with_comments</tt></i> :</span></td><td> include comments in the result (!=0) or not (==0)
135 </td></tr><tr><td><span class="term"><i><tt>filename</tt></i> :</span></td><td> the filename to store canonical XML image
136 </td></tr><tr><td><span class="term"><i><tt>compression</tt></i> :</span></td><td> the compression level (zlib requred):
139 >0 - compression level
140 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number of bytes written success or a negative value on fail
141 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlC14NIsVisibleCallback"></a>xmlC14NIsVisibleCallback ()</h3><pre class="programlisting">int (*xmlC14NIsVisibleCallback) (void *user_data,
142 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node,
143 <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> parent);</pre><p>
145 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>user_data</tt></i> :</span></td><td>
146 </td></tr><tr><td><span class="term"><i><tt>node</tt></i> :</span></td><td>
147 </td></tr><tr><td><span class="term"><i><tt>parent</tt></i> :</span></td><td>
148 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>
151 </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlC14NExecute"></a>xmlC14NExecute ()</h3><pre class="programlisting">int xmlC14NExecute (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc,
152 <a href="libxml-c14n.html#xmlC14NIsVisibleCallback">xmlC14NIsVisibleCallback</a> is_visible_callback,
155 <a href="libxml-tree.html#xmlChar">xmlChar</a> **inclusive_ns_prefixes,
157 <a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf);</pre><p>
158 Dumps the canonized image of given XML document into the provided buffer.
159 For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or
160 "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)</p><p>
162 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>doc</tt></i> :</span></td><td> the XML document for canonization
163 </td></tr><tr><td><span class="term"><i><tt>is_visible_callback</tt></i> :</span></td><td>the function to use to determine is node visible
165 </td></tr><tr><td><span class="term"><i><tt>user_data</tt></i> :</span></td><td> the first parameter for <i><tt>is_visible_callback</tt></i> function
166 (in most cases, it is nodes set)
167 </td></tr><tr><td><span class="term"><i><tt>exclusive</tt></i> :</span></td><td> the exclusive flag (0 - non-exclusive canonicalization;
168 otherwise - exclusive canonicalization)
169 </td></tr><tr><td><span class="term"><i><tt>inclusive_ns_prefixes</tt></i> :</span></td><td> the list of inclusive namespace prefixes
170 ended with a NULL or NULL if there is no
171 inclusive namespaces (only for exclusive
172 canonicalization, ignored otherwise)
173 </td></tr><tr><td><span class="term"><i><tt>with_comments</tt></i> :</span></td><td> include comments in the result (!=0) or not (==0)
174 </td></tr><tr><td><span class="term"><i><tt>buf</tt></i> :</span></td><td> the output buffer to store canonical XML; this
175 buffer MUST have encoder==NULL because C14N requires
177 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>non-negative value on success or a negative value on fail
178 </td></tr></tbody></table></div></div></div></div><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-catalog.html"><b><< catalog</b></a></td><td align="right"><a accesskey="n" href="libxml-threads.html"><b>threads >></b></a></td></tr></table></body></html>