LsmDomDocument

LsmDomDocument — Base class for DOM document nodes

Functions

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 char *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 char *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,
                                 char **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.

[out callee-allocates]

size

placeholder for the data size.

[out][optional]

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);

Get the child node that is the root element of the document.

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);

Create a new element node with a type corresponding to 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);

Create a text node with data as its initial content.

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);

Create a LsmDomView for document rendering.

Parameters

self

a LsmDomDocument

 

Returns

a new LsmDomView.

[transfer full]


lsm_dom_document_get_url ()

const char *
lsm_dom_document_get_url (LsmDomDocument *self);

Get document URL.

Parameters

self

a LsmDomDocument

 

Returns

document URL.


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