Blame doc/devhelp/libxml2-c14n.html

Packit 423ecb
Packit 423ecb
<html>
Packit 423ecb
  <head>
Packit 423ecb
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
Packit 423ecb
    <title>c14n: Provide Canonical XML and Exclusive XML Canonicalization</title>
Packit 423ecb
    <meta name="generator" content="Libxml2 devhelp stylesheet"/>
Packit 423ecb
    <link rel="start" href="index.html" title="libxml2 Reference Manual"/>
Packit 423ecb
    <link rel="up" href="general.html" title="API"/>
Packit 423ecb
    <link rel="stylesheet" href="style.css" type="text/css"/>
Packit 423ecb
    <link rel="chapter" href="general.html" title="API"/>
Packit 423ecb
  </head>
Packit 423ecb
  <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit 423ecb
    
Packit 423ecb
      
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Prev
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Up
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Home
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Next
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        libxml2 Reference Manual
Packit 423ecb
      
Packit 423ecb
    
Packit 423ecb
    

Packit 423ecb
      c14n
Packit 423ecb
    
Packit 423ecb
    

c14n - Provide Canonical XML and Exclusive XML Canonicalization

Packit 423ecb
    

the c14n modules provides a "Canonical XML" implementation

Packit 423ecb
    

Author(s): Aleksey Sanin <aleksey@aleksey.com>

Packit 423ecb
    
Packit 423ecb
      

Synopsis

Packit 423ecb
      
typedef enum xmlC14NMode;
Packit 423ecb
int	xmlC14NExecute			(xmlDocPtr doc, 
xmlC14NIsVisibleCallback is_visible_callback,
void * user_data,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf);
Packit 423ecb
int	xmlC14NDocSaveTo		(xmlDocPtr doc, 
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf);
Packit 423ecb
typedef int xmlC14NIsVisibleCallback	(void * user_data, 
xmlNodePtr node,
xmlNodePtr parent);
Packit 423ecb
int	xmlC14NDocSave			(xmlDocPtr doc, 
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
const char * filename,
int compression);
Packit 423ecb
int	xmlC14NDocDumpMemory		(xmlDocPtr doc, 
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlChar ** doc_txt_ptr);
Packit 423ecb
Packit 423ecb
    
Packit 423ecb
    
Packit 423ecb
      

Description

Packit 423ecb
    
Packit 423ecb
    
Packit 423ecb
      

Details

Packit 423ecb
      
Packit 423ecb
        

Enum xmlC14NMode

enum xmlC14NMode {
Packit 423ecb
    XML_C14N_1_0 = 0 /* Origianal C14N 1.0 spec */
Packit 423ecb
    XML_C14N_EXCLUSIVE_1_0 = 1 /* Exclusive C14N 1.0 spec */
Packit 423ecb
    XML_C14N_1_1 = 2 /*  C14N 1.1 spec */
Packit 423ecb
};
Packit 423ecb

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Signature for a C14N callback on visible nodes

Packit 423ecb
<tt>user_data</tt>:user data
<tt>node</tt>:the curent node
<tt>parent</tt>:the parent node
<tt>Returns</tt>:1 if the node should be included
Packit 423ecb
        
Packit 423ecb
        

xmlC14NDocDumpMemory ()

int	xmlC14NDocDumpMemory		(xmlDocPtr doc, 
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlChar ** doc_txt_ptr)
Packit 423ecb

Dumps the canonized image of given XML document into memory. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)

Packit 423ecb
<tt>doc</tt>:the XML document for canonization
<tt>nodes</tt>:the nodes set to be included in the canonized image or NULL if all document nodes should be included
<tt>mode</tt>:the c14n mode (see @xmlC14NMode)
<tt>inclusive_ns_prefixes</tt>:the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise)
<tt>with_comments</tt>:include comments in the result (!=0) or not (==0)
<tt>doc_txt_ptr</tt>:the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory
<tt>Returns</tt>:the number of bytes written on success or a negative value on fail
Packit 423ecb
        
Packit 423ecb
        

xmlC14NDocSave ()

int	xmlC14NDocSave			(xmlDocPtr doc, 
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
const char * filename,
int compression)
Packit 423ecb

Dumps the canonized image of given XML document into the file. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)

Packit 423ecb
<tt>doc</tt>:the XML document for canonization
<tt>nodes</tt>:the nodes set to be included in the canonized image or NULL if all document nodes should be included
<tt>mode</tt>:the c14n mode (see @xmlC14NMode)
<tt>inclusive_ns_prefixes</tt>:the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise)
<tt>with_comments</tt>:include comments in the result (!=0) or not (==0)
<tt>filename</tt>:the filename to store canonical XML image
<tt>compression</tt>:the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level
<tt>Returns</tt>:the number of bytes written success or a negative value on fail
Packit 423ecb
        
Packit 423ecb
        

xmlC14NDocSaveTo ()

int	xmlC14NDocSaveTo		(xmlDocPtr doc, 
xmlNodeSetPtr nodes,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf)
Packit 423ecb

Dumps the canonized image of given XML document into the provided buffer. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)

Packit 423ecb
<tt>doc</tt>:the XML document for canonization
<tt>nodes</tt>:the nodes set to be included in the canonized image or NULL if all document nodes should be included
<tt>mode</tt>:the c14n mode (see @xmlC14NMode)
<tt>inclusive_ns_prefixes</tt>:the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise)
<tt>with_comments</tt>:include comments in the result (!=0) or not (==0)
<tt>buf</tt>:the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output
<tt>Returns</tt>:non-negative value on success or a negative value on fail
Packit 423ecb
        
Packit 423ecb
        

xmlC14NExecute ()

int	xmlC14NExecute			(xmlDocPtr doc, 
xmlC14NIsVisibleCallback is_visible_callback,
void * user_data,
int mode,
xmlChar ** inclusive_ns_prefixes,
int with_comments,
xmlOutputBufferPtr buf)
Packit 423ecb

Dumps the canonized image of given XML document into the provided buffer. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)

Packit 423ecb
<tt>doc</tt>:the XML document for canonization
<tt>is_visible_callback</tt>:the function to use to determine is node visible or not
<tt>user_data</tt>:the first parameter for @is_visible_callback function (in most cases, it is nodes set)
<tt>mode</tt>:the c14n mode (see @xmlC14NMode)
<tt>inclusive_ns_prefixes</tt>:the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise)
<tt>with_comments</tt>:include comments in the result (!=0) or not (==0)
<tt>buf</tt>:the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output
<tt>Returns</tt>:non-negative value on success or a negative value on fail
Packit 423ecb
        
Packit 423ecb
      
Packit 423ecb
    
Packit 423ecb
  </body>
Packit 423ecb
</html>