## LsmDomDocument LsmDomDocument — Base class for DOM document nodes |

## Functions

LsmDomDocument * | (*LsmDomDocumentCreateFunction) ()
LsmDomDocument * | lsm_dom_implementation_create_document ()
void | lsm_dom_implementation_cleanup ()
void | lsm_dom_document_append_from_memory ()
LsmDomDocument * | lsm_dom_document_new_from_memory ()
LsmDomDocument * | lsm_dom_document_new_from_path ()
LsmDomDocument * | lsm_dom_document_new_from_url ()
void | lsm_dom_document_save_to_stream ()
void | lsm_dom_document_save_to_memory ()
void | lsm_dom_document_save_to_path ()
void | lsm_dom_document_save_to_url ()
LsmDomElement * | lsm_dom_document_get_document_element ()
LsmDomElement * | lsm_dom_document_create_element ()
LsmDomText * | lsm_dom_document_create_text_node ()
LsmDomView * | lsm_dom_document_create_view ()
const char * | lsm_dom_document_get_url ()
void | lsm_dom_document_set_url ()
void | lsm_dom_document_set_path ()
void * | lsm_dom_document_get_href_data ()
const char * | lsm_dom_get_entity ()

## Types and Values

| LsmDomDocument

## Object Hierarchy

        GObject
        ╰── LsmDomNode
            ╰── LsmDomDocument

## Description

## Functions

### LsmDomDocumentCreateFunction ()

    LsmDomDocument *
    (*LsmDomDocumentCreateFunction) (void);

### lsm_dom_implementation_create_document ()

    LsmDomDocument *
    lsm_dom_implementation_create_document
                                   (const char *namespace_uri,
                                    const char *qualified_name);

#### Parameters

namespace_uri | namespace uri |
qualified_name | qualified name |

#### Returns

a new LsmDomDocument.

[transfer full]

### lsm_dom_implementation_cleanup ()

    void
    lsm_dom_implementation_cleanup (void);

### lsm_dom_document_append_from_memory ()

    void
    lsm_dom_document_append_from_memory (LsmDomDocument *document,
                                         LsmDomNode *node,
                                         const void *buffer,
                                         gssize size,
                                         GError **error);

Append a chunk of xml tree to an existing document. The resulting nodes will be appended to `node` , or to `document` if `node` == NULL.

Size set to -1 indicates the buffer is NULL terminated.

#### Parameters

document | a LsmDomDocument |
node | a LsmDomNode |
buffer | a memory buffer holding xml data |
size | size of the xml data, in bytes, -1 if NULL terminated |
error | an error placeholder |

### lsm_dom_document_new_from_memory ()

    LsmDomDocument *
    lsm_dom_document_new_from_memory (const void *buffer,
                                      gssize size,
                                      GError **error);

Create a new document from a memory data buffer.

#### Parameters

buffer | xml data |
size | size of the data, in bytes, -1 if NULL terminated |
error | an error placeholder |

### lsm_dom_document_new_from_path ()

    LsmDomDocument *
    lsm_dom_document_new_from_path (const char *path,
                                    GError **error);

Create a new document from the data stored in `path` .

#### Parameters

path | a file path |
error | an error placeholder |

### lsm_dom_document_new_from_url ()

    LsmDomDocument *
    lsm_dom_document_new_from_url (const char *url,
                                   GError **error);

Create a new document from the data stored at `url` .

#### Parameters

url | a file url |
error | an error placeholder |

### lsm_dom_document_save_to_stream ()

    void
    lsm_dom_document_save_to_stream (LsmDomDocument *document,
                                     GOutputStream *stream,
                                     GError **error);

Save `document` as an xml representation into `stream` .

#### Parameters

document | a LsmDomDocument |
stream | stream to save to |
error | an error placeholder |

### lsm_dom_document_save_to_memory ()

    void
    lsm_dom_document_save_to_memory (LsmDomDocument *document,
                                     void **buffer,
                                     gsize *size,
                                     GError **error);

Save `document` as an xml representation into `buffer` .

#### Parameters

document | a LsmDomDocument |
buffer | placeholder for a pointer to the resulting data buffer |
size | placeholder for the data size |
error | placeholder for a GError |

### lsm_dom_document_save_to_path ()

    void
    lsm_dom_document_save_to_path (LsmDomDocument *document,
                                   const char *path,
                                   GError **error);

Save `document` as an xml representation to a file, replacing the already existing file if needed.

#### Parameters

document | a LsmDomDocument |
path | a file path |
error | placeholder for a GError |

### lsm_dom_document_save_to_url ()

    void
    lsm_dom_document_save_to_url (LsmDomDocument *document,
                                  const char *url,
                                  GError **error);

Save `document` as an xml representation to `url` , replacing the already existing file if needed.

#### Parameters

document | a LsmDomDocument |
url | an url |
error | placeholder for a GError |

### lsm_dom_document_get_document_element ()

    LsmDomElement *
    lsm_dom_document_get_document_element (LsmDomDocument *self);

#### Parameters

self | a LsmDomElement |

#### Returns

document element.

[transfer none]

### lsm_dom_document_create_element ()

    LsmDomElement *
    lsm_dom_document_create_element (LsmDomDocument *self,
                                     const char *tag_name);

#### Parameters

self | a LsmDomDocument |
tag_name | name of the element to create |

#### Returns

a newly created LsmDomElement.

[transfer full]

### lsm_dom_document_create_text_node ()

    LsmDomText *
    lsm_dom_document_create_text_node (LsmDomDocument *self,
                                       const char *data);

#### Parameters

self | a LsmDomDocument |
data | content of the text node |

#### Returns

a newly created LsmDomText.

[transfer full]

### lsm_dom_document_create_view ()

    LsmDomView *
    lsm_dom_document_create_view (LsmDomDocument *self);

#### Parameters

self | a LsmDomDocument |

#### Returns

a new LsmDomView.

[transfer full]

### lsm_dom_document_get_url ()

    const char *
    lsm_dom_document_get_url (LsmDomDocument *self);

### lsm_dom_document_set_url ()

    void
    lsm_dom_document_set_url (LsmDomDocument *self,
                              const char *url);

### lsm_dom_document_set_path ()

    void
    lsm_dom_document_set_path (LsmDomDocument *self,
                               const char *path);

### lsm_dom_document_get_href_data ()

    void *
    lsm_dom_document_get_href_data (LsmDomDocument *self,
                                    const char *href,
                                    gsize *size);

#### Parameters

self | a LsmDomDocument |
href | href |
size | placeholder for the size of the returned data |

#### Returns

a newly allocated buffer containing the requested data.

[transfer full]

### lsm_dom_get_entity ()

    const char *
    lsm_dom_get_entity (const char *name);

## Types and Values

### LsmDomDocument

    typedef struct _LsmDomDocument LsmDomDocument;