XML

## XML XML — XML and XML Writer |

## Functions

raptor_xml_element * | raptor_new_xml_element ()
raptor_xml_element * | raptor_new_xml_element_from_namespace_local_name ()
void | raptor_free_xml_element ()
raptor_qname * | raptor_xml_element_get_name ()
raptor_qname ** | raptor_xml_element_get_attributes ()
int | raptor_xml_element_get_attributes_count ()
void | raptor_xml_element_set_attributes ()
int | raptor_xml_element_declare_namespace ()
int | raptor_xml_element_is_empty ()
const unsigned char * | raptor_xml_element_get_language ()
int | raptor_xml_element_write ()
raptor_xml_writer * | raptor_new_xml_writer ()
void | raptor_free_xml_writer ()
void | raptor_xml_writer_empty_element ()
void | raptor_xml_writer_start_element ()
void | raptor_xml_writer_end_element ()
void | raptor_xml_writer_cdata ()
void | raptor_xml_writer_cdata_counted ()
void | raptor_xml_writer_raw ()
void | raptor_xml_writer_raw_counted ()
void | raptor_xml_writer_comment ()
void | raptor_xml_writer_comment_counted ()
void | raptor_xml_writer_flush ()
void | raptor_xml_writer_newline ()
int | raptor_xml_writer_get_depth ()
int | raptor_xml_writer_set_option ()
int | raptor_xml_writer_get_option ()
int | raptor_xml_escape_string_any ()
int | raptor_xml_escape_string_any_write ()
int | raptor_xml_escape_string ()
int | raptor_xml_escape_string_write ()
int | raptor_xml_name_check ()

## Types and Values

typedef | raptor_xml_element
typedef | raptor_xml_writer

## Description

XML elements with optional attributes and an XML Writer class that can format raptor_xml_element into output forms, with optional "pretty printing" features such as indenting and collapsing empty elements.

Also includes a utility function raptor_xml_name_check for checking a name is legal in some XML version.

## Functions

### raptor_new_xml_element ()

    raptor_xml_element *
    raptor_new_xml_element (raptor_qname *name,
                            const unsigned char *xml_language,
                            raptor_uri *xml_base);

#### Returns

### raptor_new_xml_element_from_namespace_local_name ()

    raptor_xml_element *
    raptor_new_xml_element_from_namespace_local_name
                                   (raptor_namespace *ns,
                                    const unsigned char *name,
                                    const unsigned char *xml_language,
                                    raptor_uri *xml_base);

#### Returns

### raptor_free_xml_element ()

    void
    raptor_free_xml_element (raptor_xml_element *element);

### raptor_xml_element_get_name ()

    raptor_qname *
    raptor_xml_element_get_name (raptor_xml_element *xml_element);

#### Returns

### raptor_xml_element_get_attributes ()

    raptor_qname **
    raptor_xml_element_get_attributes (raptor_xml_element *xml_element);

#### Returns

### raptor_xml_element_get_attributes_count ()

    int
    raptor_xml_element_get_attributes_count
                                   (raptor_xml_element *xml_element);

#### Returns

### raptor_xml_element_set_attributes ()

    void
    raptor_xml_element_set_attributes (raptor_xml_element *xml_element,
                                       raptor_qname **attributes,
                                       int count);

### raptor_xml_element_declare_namespace ()

    int
    raptor_xml_element_declare_namespace (raptor_xml_element *xml_element,
                                          raptor_namespace *nspace);

#### Returns

### raptor_xml_element_is_empty ()

    int
    raptor_xml_element_is_empty (raptor_xml_element *xml_element);

#### Returns

### raptor_xml_element_get_language ()

    const unsigned char *
    raptor_xml_element_get_language (raptor_xml_element *xml_element);

#### Returns

### raptor_xml_element_write ()

    int
    raptor_xml_element_write (raptor_xml_element *element,
                              raptor_namespace_stack *nstack,
                              int is_empty,
                              int is_end,
                              int depth,
                              raptor_iostream *iostr);

#### Returns

### raptor_new_xml_writer ()

    raptor_xml_writer *
    raptor_new_xml_writer (raptor_world *world,
                           raptor_namespace_stack *nstack,
                           raptor_iostream *iostr);

#### Returns

### raptor_free_xml_writer ()

    void
    raptor_free_xml_writer (raptor_xml_writer *xml_writer);

### raptor_xml_writer_empty_element ()

    void
    raptor_xml_writer_empty_element (raptor_xml_writer *xml_writer,
                                     raptor_xml_element *element);

### raptor_xml_writer_start_element ()

    void
    raptor_xml_writer_start_element (raptor_xml_writer *xml_writer,
                                     raptor_xml_element *element);

### raptor_xml_writer_end_element ()

    void
    raptor_xml_writer_end_element (raptor_xml_writer *xml_writer,
                                   raptor_xml_element *element);

### raptor_xml_writer_cdata ()

    void
    raptor_xml_writer_cdata (raptor_xml_writer *xml_writer,
                             const unsigned char *s);

### raptor_xml_writer_cdata_counted ()

    void
    raptor_xml_writer_cdata_counted (raptor_xml_writer *xml_writer,
                                     const unsigned char *s,
                                     unsigned int len);

### raptor_xml_writer_raw ()

    void
    raptor_xml_writer_raw (raptor_xml_writer *xml_writer,
                           const unsigned char *s);

### raptor_xml_writer_raw_counted ()

    void
    raptor_xml_writer_raw_counted (raptor_xml_writer *xml_writer,
                                   const unsigned char *s,
                                   unsigned int len);

### raptor_xml_writer_comment ()

    void
    raptor_xml_writer_comment (raptor_xml_writer *xml_writer,
                               const unsigned char *s);

### raptor_xml_writer_comment_counted ()

    void
    raptor_xml_writer_comment_counted (raptor_xml_writer *xml_writer,
                                       const unsigned char *s,
                                       unsigned int len);

### raptor_xml_writer_flush ()

    void
    raptor_xml_writer_flush (raptor_xml_writer *xml_writer);

### raptor_xml_writer_newline ()

    void
    raptor_xml_writer_newline (raptor_xml_writer *xml_writer);

### raptor_xml_writer_get_depth ()

    int
    raptor_xml_writer_get_depth (raptor_xml_writer *xml_writer);

#### Returns

### raptor_xml_writer_set_option ()

    int
    raptor_xml_writer_set_option (raptor_xml_writer *xml_writer,
                                  raptor_option option,
                                  char *string,
                                  int integer);

#### Returns

### raptor_xml_writer_get_option ()

    int
    raptor_xml_writer_get_option (raptor_xml_writer *xml_writer,
                                  raptor_option option,
                                  char **string_p,
                                  int *integer_p);

#### Returns

### raptor_xml_escape_string_any ()

    int
    raptor_xml_escape_string_any (raptor_world *world,
                                  const unsigned char *string,
                                  size_t len,
                                  unsigned char *buffer,
                                  size_t length,
                                  char quote,
                                  int xml_version);

#### Returns

### raptor_xml_escape_string_any_write ()

    int
    raptor_xml_escape_string_any_write (const unsigned char *string,
                                        size_t len,
                                        char quote,
                                        int xml_version,
                                        raptor_iostream *iostr);

#### Returns

### raptor_xml_escape_string ()

    int
    raptor_xml_escape_string (raptor_world *world,
                              const unsigned char *string,
                              size_t len,
                              unsigned char *buffer,
                              size_t length,
                              char quote);

#### Returns

### raptor_xml_escape_string_write ()

    int
    raptor_xml_escape_string_write (const unsigned char *string,
                                    size_t len,
                                    char quote,
                                    raptor_iostream *iostr);

#### Returns

### raptor_xml_name_check ()

    int
    raptor_xml_name_check (const unsigned char *string,
                           size_t length,
                           int xml_version);

#### Returns

## Types and Values

### raptor_xml_element

    raptor_xml_element* raptor_xml_element;

Raptor XML Element class

### raptor_xml_writer

    raptor_xml_writer* raptor_xml_writer;

Raptor XML Writer class