Gnome XML Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# xmlIO

## Name

xmlIO --

## Synopsis

    int         (*xmlInputMatchCallback)        (char const *filename);
    void*       (*xmlInputOpenCallback)         (char const *filename);
    int         (*xmlInputReadCallback)         (void *context,
                                                 char *buffer,
                                                 int len);
    void        (*xmlInputCloseCallback)        (void *context);
    struct      xmlParserInputBuffer;
    typedef     xmlParserInputBufferPtr;
    int         (*xmlOutputMatchCallback)       (char const *filename);
    void*       (*xmlOutputOpenCallback)        (char const *filename);
    int         (*xmlOutputWriteCallback)       (void *context,
                                                 const char *buffer,
                                                 int len);
    void        (*xmlOutputCloseCallback)       (void *context);
    struct      xmlOutputBuffer;
    typedef     xmlOutputBufferPtr;
    void        xmlRegisterDefaultInputCallbacks
                                                (void);
    xmlParserInputBufferPtr xmlAllocParserInputBuffer
                                                (xmlCharEncoding enc);
    xmlParserInputBufferPtr xmlParserInputBufferCreateFname
                                                (const char *URI,
                                                 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);
    int         xmlSaveFileTo                   (xmlOutputBuffer *buf,
                                                 xmlDocPtr cur,
                                                 const char *encoding);
    int         xmlSaveFormatFileTo             (xmlOutputBuffer *buf,
                                                 xmlDocPtr cur,
                                                 const char *encoding,
                                                 int format);
    void        xmlNodeDumpOutput               (xmlOutputBufferPtr buf,
                                                 xmlDocPtr doc,
                                                 xmlNodePtr cur,
                                                 int level,
                                                 int format,
                                                 const char *encoding);
    void        htmlDocContentDumpOutput        (xmlOutputBufferPtr buf,
                                                 xmlDocPtr cur,
                                                 const char *encoding);

## Description

## Details

### xmlInputMatchCallback ()

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

`filename` : |
Returns : |

### xmlInputOpenCallback ()

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

`filename` : |

### xmlInputReadCallback ()

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

`context` : |
`buffer` : |
`len` : |
Returns : |

### xmlInputCloseCallback ()

    void        (*xmlInputCloseCallback)        (void *context);

`context` : |

### 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 */
    };

### xmlParserInputBufferPtr

### xmlOutputMatchCallback ()

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

`filename` : |
Returns : |

### xmlOutputOpenCallback ()

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

`filename` : |

### xmlOutputWriteCallback ()

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

`context` : |
`buffer` : |
`len` : |
Returns : |

### xmlOutputCloseCallback ()

    void        (*xmlOutputCloseCallback)       (void *context);

`context` : |

### 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 */
    };

### xmlOutputBufferPtr

### 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 : |

### xmlParserInputBufferCreateFname ()

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

`URI` : |
`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 directy 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);

`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 : |

### xmlSaveFileTo ()

    int         xmlSaveFileTo                   (xmlOutputBuffer *buf,
                                                 xmlDocPtr cur,
                                                 const char *encoding);

Dump an XML document to an I/O buffer.

`buf` : |
`cur` : |
`encoding` : |
Returns : |

### xmlSaveFormatFileTo ()

    int         xmlSaveFormatFileTo             (xmlOutputBuffer *buf,
                                                 xmlDocPtr cur,
                                                 const char *encoding,
                                                 int format);

Dump an XML document to an I/O buffer.

`buf` : |
`cur` : |
`encoding` : |
`format` : |
Returns : |

### xmlNodeDumpOutput ()

    void        xmlNodeDumpOutput               (xmlOutputBufferPtr buf,
                                                 xmlDocPtr doc,
                                                 xmlNodePtr cur,
                                                 int level,
                                                 int format,
                                                 const char *encoding);

Dump an XML node, recursive behaviour,children are printed too.

`buf` : |
`doc` : |
`cur` : |
`level` : |
`format` : |
`encoding` : |

### htmlDocContentDumpOutput ()

    void        htmlDocContentDumpOutput        (xmlOutputBufferPtr buf,
                                                 xmlDocPtr cur,
                                                 const char *encoding);

Dump an HTML document. Formating return/spaces are added.

`buf` : |
`cur` : |
`encoding` : |

<<< Previous Page | Home | Up | Next Page >>>
nanoftp | catalog