xmlIO

xmlIO —

Synopsis




int         (*xmlInputMatchCallback)        (char const *filename);
void*       (*xmlInputOpenCallback)         (char const *filename);
int         (*xmlInputReadCallback)         (void *context,
                                             char *buffer,
                                             int len);
int         (*xmlInputCloseCallback)        (void *context);
int         (*xmlOutputMatchCallback)       (char const *filename);
void*       (*xmlOutputOpenCallback)        (char const *filename);
int         (*xmlOutputWriteCallback)       (void *context,
                                             const char *buffer,
                                             int len);
int         (*xmlOutputCloseCallback)       (void *context);
struct      xmlParserInputBuffer;
struct      xmlOutputBuffer;
void        xmlCleanupInputCallbacks        (void);
void        xmlCleanupOutputCallbacks       (void);
void        xmlRegisterDefaultInputCallbacks
                                            (void);
xmlParserInputBufferPtr xmlAllocParserInputBuffer
                                            (xmlCharEncoding enc);
xmlParserInputBufferPtr xmlParserInputBufferCreateFilename
                                            (const char *URI,
                                             xmlCharEncoding enc);
xmlParserInputBufferPtr xmlParserInputBufferCreateFile
                                            (FILE *file,
                                             xmlCharEncoding enc);
xmlParserInputBufferPtr xmlParserInputBufferCreateFd
                                            (int fd,
                                             xmlCharEncoding enc);
xmlParserInputBufferPtr xmlParserInputBufferCreateMem
                                            (const char *mem,
                                             int size,
                                             xmlCharEncoding enc);
xmlParserInputBufferPtr xmlParserInputBufferCreateIO
                                            (xmlInputReadCallback ioread,
                                             xmlInputCloseCallback ioclose,
                                             void *ioctx,
                                             xmlCharEncoding enc);
int         xmlParserInputBufferRead        (xmlParserInputBufferPtr in,
                                             int len);
int         xmlParserInputBufferGrow        (xmlParserInputBufferPtr in,
                                             int len);
int         xmlParserInputBufferPush        (xmlParserInputBufferPtr in,
                                             int len,
                                             const char *buf);
void        xmlFreeParserInputBuffer        (xmlParserInputBufferPtr in);
char*       xmlParserGetDirectory           (const char *filename);
int         xmlRegisterInputCallbacks       (xmlInputMatchCallback matchFunc,
                                             xmlInputOpenCallback openFunc,
                                             xmlInputReadCallback readFunc,
                                             xmlInputCloseCallback closeFunc);
void        xmlRegisterDefaultOutputCallbacks
                                            (void);
xmlOutputBufferPtr xmlAllocOutputBuffer     (xmlCharEncodingHandlerPtr encoder);
xmlOutputBufferPtr xmlOutputBufferCreateFilename
                                            (const char *URI,
                                             xmlCharEncodingHandlerPtr encoder,
                                             int compression);
xmlOutputBufferPtr xmlOutputBufferCreateFile
                                            (FILE *file,
                                             xmlCharEncodingHandlerPtr encoder);
xmlOutputBufferPtr xmlOutputBufferCreateFd  (int fd,
                                             xmlCharEncodingHandlerPtr encoder);
xmlOutputBufferPtr xmlOutputBufferCreateIO  (xmlOutputWriteCallback iowrite,
                                             xmlOutputCloseCallback ioclose,
                                             void *ioctx,
                                             xmlCharEncodingHandlerPtr encoder);
int         xmlOutputBufferWrite            (xmlOutputBufferPtr out,
                                             int len,
                                             const char *buf);
int         xmlOutputBufferWriteString      (xmlOutputBufferPtr out,
                                             const char *str);
int         xmlOutputBufferFlush            (xmlOutputBufferPtr out);
int         xmlOutputBufferClose            (xmlOutputBufferPtr out);
int         xmlRegisterOutputCallbacks      (xmlOutputMatchCallback matchFunc,
                                             xmlOutputOpenCallback openFunc,
                                             xmlOutputWriteCallback writeFunc,
                                             xmlOutputCloseCallback closeFunc);
void*       xmlIOHTTPOpenW                  (const char *post_uri,
                                             int compression);
void        xmlRegisterHTTPPostCallbacks    (void);
xmlParserInputPtr xmlNoNetExternalEntityLoader
                                            (const char *URL,
                                             const char *ID,
                                             xmlParserCtxtPtr ctxt);
xmlChar*    xmlNormalizeWindowsPath         (const xmlChar *path);
int         xmlCheckFilename                (const char *path);
int         xmlFileMatch                    (const char *filename);
void*       xmlFileOpen                     (const char *filename);
int         xmlFileRead                     (void *context,
                                             char *buffer,
                                             int len);
int         xmlFileClose                    (void *context);
int         xmlIOHTTPMatch                  (const char *filename);
void*       xmlIOHTTPOpen                   (const char *filename);
int         xmlIOHTTPRead                   (void *context,
                                             char *buffer,
                                             int len);
int         xmlIOHTTPClose                  (void *context);
int         xmlIOFTPMatch                   (const char *filename);
void*       xmlIOFTPOpen                    (const char *filename);
int         xmlIOFTPRead                    (void *context,
                                             char *buffer,
                                             int len);
int         xmlIOFTPClose                   (void *context);

Description

Details

xmlInputMatchCallback ()

int         (*xmlInputMatchCallback)        (char const *filename);

Callback used in the I/O Input API to detect if the current handler can provide input fonctionnalities for this resource.

filename :
Returns :

xmlInputOpenCallback ()

void*       (*xmlInputOpenCallback)         (char const *filename);

Callback used in the I/O Input API to open the resource

filename :

xmlInputReadCallback ()

int         (*xmlInputReadCallback)         (void *context,
                                             char *buffer,
                                             int len);

Callback used in the I/O Input API to read the resource

context :
buffer :
len :
Returns :

xmlInputCloseCallback ()

int         (*xmlInputCloseCallback)        (void *context);

Callback used in the I/O Input API to close the resource

context :
Returns :

xmlOutputMatchCallback ()

int         (*xmlOutputMatchCallback)       (char const *filename);

Callback used in the I/O Output API to detect if the current handler can provide output fonctionnalities for this resource.

filename :
Returns :

xmlOutputOpenCallback ()

void*       (*xmlOutputOpenCallback)        (char const *filename);

Callback used in the I/O Output API to open the resource

filename :

xmlOutputWriteCallback ()

int         (*xmlOutputWriteCallback)       (void *context,
                                             const char *buffer,
                                             int len);

Callback used in the I/O Output API to write to the resource

context :
buffer :
len :
Returns :

xmlOutputCloseCallback ()

int         (*xmlOutputCloseCallback)       (void *context);

Callback used in the I/O Output API to close the resource

context :
Returns :

struct xmlParserInputBuffer

struct xmlParserInputBuffer {
    void*                  context;
    xmlInputReadCallback   readcallback;
    xmlInputCloseCallback  closecallback;
    
    xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
    
    xmlBufferPtr buffer;    /* Local buffer encoded in UTF-8 */
    xmlBufferPtr raw;       /* if encoder != NULL buffer for raw input */
};


struct xmlOutputBuffer

struct xmlOutputBuffer {
    void*                   context;
    xmlOutputWriteCallback  writecallback;
    xmlOutputCloseCallback  closecallback;
    
    xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
    
    xmlBufferPtr buffer;    /* Local buffer encoded in UTF-8 or ISOLatin */
    xmlBufferPtr conv;      /* if encoder != NULL buffer for output */
    int written;            /* total number of byte written */
};


xmlCleanupInputCallbacks ()

void        xmlCleanupInputCallbacks        (void);

clears the entire input callback table. this includes the compiled-in I/O.


xmlCleanupOutputCallbacks ()

void        xmlCleanupOutputCallbacks       (void);

clears the entire output callback table. this includes the compiled-in I/O callbacks.


xmlRegisterDefaultInputCallbacks ()

void        xmlRegisterDefaultInputCallbacks
                                            (void);

Registers the default compiled-in I/O handlers.


xmlAllocParserInputBuffer ()

xmlParserInputBufferPtr xmlAllocParserInputBuffer
                                            (xmlCharEncoding enc);

Create a buffered parser input for progressive parsing

enc :
Returns :

xmlParserInputBufferCreateFilename ()

xmlParserInputBufferPtr xmlParserInputBufferCreateFilename
                                            (const char *URI,
                                             xmlCharEncoding enc);

Create a buffered parser input for the progressive parsing of a file If filename is "-' then we use stdin as the input. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. Do an encoding check if enc == XML_CHAR_ENCODING_NONE

URI :
enc :
Returns :

xmlParserInputBufferCreateFile ()

xmlParserInputBufferPtr xmlParserInputBufferCreateFile
                                            (FILE *file,
                                             xmlCharEncoding enc);

Create a buffered parser input for the progressive parsing of a FILE * buffered C I/O

file :
enc :
Returns :

xmlParserInputBufferCreateFd ()

xmlParserInputBufferPtr xmlParserInputBufferCreateFd
                                            (int fd,
                                             xmlCharEncoding enc);

Create a buffered parser input for the progressive parsing for the input from a file descriptor

fd :
enc :
Returns :

xmlParserInputBufferCreateMem ()

xmlParserInputBufferPtr xmlParserInputBufferCreateMem
                                            (const char *mem,
                                             int size,
                                             xmlCharEncoding enc);

Create a buffered parser input for the progressive parsing for the input from a memory area.

mem :
size :
enc :
Returns :

xmlParserInputBufferCreateIO ()

xmlParserInputBufferPtr xmlParserInputBufferCreateIO
                                            (xmlInputReadCallback ioread,
                                             xmlInputCloseCallback ioclose,
                                             void *ioctx,
                                             xmlCharEncoding enc);

Create a buffered parser input for the progressive parsing for the input from an I/O handler

ioread :
ioclose :
ioctx :
enc :
Returns :

xmlParserInputBufferRead ()

int         xmlParserInputBufferRead        (xmlParserInputBufferPtr in,
                                             int len);

Refresh the content of the input buffer, the old data are considered consumed This routine handle the I18N transcoding to internal UTF-8

in :
len :
Returns :

xmlParserInputBufferGrow ()

int         xmlParserInputBufferGrow        (xmlParserInputBufferPtr in,
                                             int len);

Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode

TODO: one should be able to remove one extra copy by copying directly onto in->buffer or in->raw

in :
len :
Returns :

xmlParserInputBufferPush ()

int         xmlParserInputBufferPush        (xmlParserInputBufferPtr in,
                                             int len,
                                             const char *buf);

Push the content of the arry in the input buffer This routine handle the I18N transcoding to internal UTF-8 This is used when operating the parser in progressive (push) mode.

in :
len :
buf :
Returns :

xmlFreeParserInputBuffer ()

void        xmlFreeParserInputBuffer        (xmlParserInputBufferPtr in);

Free up the memory used by a buffered parser input

in :

xmlParserGetDirectory ()

char*       xmlParserGetDirectory           (const char *filename);

lookup the directory for that file

filename :
Returns :

xmlRegisterInputCallbacks ()

int         xmlRegisterInputCallbacks       (xmlInputMatchCallback matchFunc,
                                             xmlInputOpenCallback openFunc,
                                             xmlInputReadCallback readFunc,
                                             xmlInputCloseCallback closeFunc);

Register a new set of I/O callback for handling parser input.

matchFunc :
openFunc :
readFunc :
closeFunc :
Returns :

xmlRegisterDefaultOutputCallbacks ()

void        xmlRegisterDefaultOutputCallbacks
                                            (void);

Registers the default compiled-in I/O handlers.


xmlAllocOutputBuffer ()

xmlOutputBufferPtr xmlAllocOutputBuffer     (xmlCharEncodingHandlerPtr encoder);

Create a buffered parser output

encoder :
Returns :

xmlOutputBufferCreateFilename ()

xmlOutputBufferPtr xmlOutputBufferCreateFilename
                                            (const char *URI,
                                             xmlCharEncodingHandlerPtr encoder,
                                             int compression);

Create a buffered output for the progressive saving of a file If filename is "-' then we use stdout as the output. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. TODO: currently if compression is set, the library only support writing to a local file.

URI :
encoder :
compression :
Returns :

xmlOutputBufferCreateFile ()

xmlOutputBufferPtr xmlOutputBufferCreateFile
                                            (FILE *file,
                                             xmlCharEncodingHandlerPtr encoder);

Create a buffered output for the progressive saving to a FILE * buffered C I/O

file :
encoder :
Returns :

xmlOutputBufferCreateFd ()

xmlOutputBufferPtr xmlOutputBufferCreateFd  (int fd,
                                             xmlCharEncodingHandlerPtr encoder);

Create a buffered output for the progressive saving to a file descriptor

fd :
encoder :
Returns :

xmlOutputBufferCreateIO ()

xmlOutputBufferPtr xmlOutputBufferCreateIO  (xmlOutputWriteCallback iowrite,
                                             xmlOutputCloseCallback ioclose,
                                             void *ioctx,
                                             xmlCharEncodingHandlerPtr encoder);

Create a buffered output for the progressive saving to an I/O handler

iowrite :
ioclose :
ioctx :
encoder :
Returns :

xmlOutputBufferWrite ()

int         xmlOutputBufferWrite            (xmlOutputBufferPtr out,
                                             int len,
                                             const char *buf);

Write the content of the array in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes.

out :
len :
buf :
Returns :

xmlOutputBufferWriteString ()

int         xmlOutputBufferWriteString      (xmlOutputBufferPtr out,
                                             const char *str);

Write the content of the string in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes.

out :
str :
Returns :

xmlOutputBufferFlush ()

int         xmlOutputBufferFlush            (xmlOutputBufferPtr out);

flushes the output I/O channel

out :
Returns :

xmlOutputBufferClose ()

int         xmlOutputBufferClose            (xmlOutputBufferPtr out);

flushes and close the output I/O channel and free up all the associated resources

out :
Returns :

xmlRegisterOutputCallbacks ()

int         xmlRegisterOutputCallbacks      (xmlOutputMatchCallback matchFunc,
                                             xmlOutputOpenCallback openFunc,
                                             xmlOutputWriteCallback writeFunc,
                                             xmlOutputCloseCallback closeFunc);

Register a new set of I/O callback for handling output.

matchFunc :
openFunc :
writeFunc :
closeFunc :
Returns :

xmlIOHTTPOpenW ()

void*       xmlIOHTTPOpenW                  (const char *post_uri,
                                             int compression);

Open a temporary buffer to collect the document for a subsequent HTTP POST request. Non-static as is called from the output buffer creation routine.

post_uri :
compression :

xmlRegisterHTTPPostCallbacks ()

void        xmlRegisterHTTPPostCallbacks    (void);

By default, libxml submits HTTP output requests using the "PUT" method. Calling this method changes the HTTP output method to use the "POST" method instead.


xmlNoNetExternalEntityLoader ()

xmlParserInputPtr xmlNoNetExternalEntityLoader
                                            (const char *URL,
                                             const char *ID,
                                             xmlParserCtxtPtr ctxt);

A specific entity loader disabling network accesses, though still allowing local catalog accesses for resolution.

URL :
ID :
ctxt :
Returns :

xmlNormalizeWindowsPath ()

xmlChar*    xmlNormalizeWindowsPath         (const xmlChar *path);

This function is obsolete. Please see xmlURIFromPath in uri.c for a better solution.

path :
Returns :

xmlCheckFilename ()

int         xmlCheckFilename                (const char *path);

function checks to see if path is a valid source (file, socket...) for XML.

if stat is not available on the target machine, returns 1. if stat fails, returns 0 (if calling stat on the filename fails, it can't be right). if stat succeeds and the file is a directory,

path :
Returns :

xmlFileMatch ()

int         xmlFileMatch                    (const char *filename);

input from FILE *

filename :
Returns :

xmlFileOpen ()

void*       xmlFileOpen                     (const char *filename);

Wrapper around xmlFileOpen_real that try it with an unescaped version of filename, if this fails fallback to filename

filename :

xmlFileRead ()

int         xmlFileRead                     (void *context,
                                             char *buffer,
                                             int len);

Read len bytes to buffer from the I/O channel.

context :
buffer :
len :
Returns :

xmlFileClose ()

int         xmlFileClose                    (void *context);

Close an I/O channel

context :
Returns :

xmlIOHTTPMatch ()

int         xmlIOHTTPMatch                  (const char *filename);

check if the URI matches an HTTP one

filename :
Returns :

xmlIOHTTPOpen ()

void*       xmlIOHTTPOpen                   (const char *filename);

open an HTTP I/O channel

filename :

xmlIOHTTPRead ()

int         xmlIOHTTPRead                   (void *context,
                                             char *buffer,
                                             int len);

Read len bytes to buffer from the I/O channel.

context :
buffer :
len :
Returns :

xmlIOHTTPClose ()

int         xmlIOHTTPClose                  (void *context);

Close an HTTP I/O channel

context :
Returns :

xmlIOFTPMatch ()

int         xmlIOFTPMatch                   (const char *filename);

check if the URI matches an FTP one

filename :
Returns :

xmlIOFTPOpen ()

void*       xmlIOFTPOpen                    (const char *filename);

open an FTP I/O channel

filename :

xmlIOFTPRead ()

int         xmlIOFTPRead                    (void *context,
                                             char *buffer,
                                             int len);

Read len bytes to buffer from the I/O channel.

context :
buffer :
len :
Returns :

xmlIOFTPClose ()

int         xmlIOFTPClose                   (void *context);

Close an FTP I/O channel

context :
Returns :