Skip to main content

tx_element_set_text

Function tx_element_set_text 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tx_element_set_text( doc: *mut TxDocument, element: TxNodeId, text: *const c_char, ) -> TxError
Expand description

Sets the text content of an element.

If a child text node exists, its content is replaced. Otherwise, a new text node is created and inserted as the first child.

ยงSafety

  • doc must be a valid, non-null pointer to a TxDocument.
  • text must be a valid, non-null pointer to a null-terminated UTF-8 string.