Function yrs::yxmlelem_insert_elem[][src]

#[no_mangle]
pub unsafe extern "C" fn yxmlelem_insert_elem(
    xml: *const XmlElement,
    txn: *mut Transaction,
    index: c_int,
    name: *const c_char
) -> *mut XmlElement
Expand description

Inserts an YXmlElement as a child of a current node at the given index and returns its pointer. Node created this way will have a given name as its tag (eg. p for <p></p> node).

An index value must be between 0 and (inclusive) length of a current XML element (use yxmlelem_child_len function to determine its length).

A name must be a null-terminated UTF-8 encoded string, which will be copied into current document. Therefore name should be freed by the function caller.