Skip to main content

set_prop

Function set_prop 

Source
pub unsafe fn set_prop(
    node: *mut _xmlNode,
    name: *const xmlChar,
    value: *const xmlChar,
) -> *mut _xmlAttr
Expand description

Set an attribute on a node.

§UPSTREAM-PARITY

xmlAttrPtr xmlSetProp(xmlNodePtr node, const xmlChar *name, const xmlChar *value);

Sets the attribute with the given name to the given value. If the attribute already exists, its value is updated. Creates the attribute if it doesn’t exist.

Returns the attribute pointer, or NULL on failure.

§SAFETY

  • node must be a valid pointer to an _xmlNode, or NULL.
  • name must be a valid null-terminated string.
  • value must be a valid null-terminated string or NULL.