Skip to main content

add_attribute_decl

Function add_attribute_decl 

Source
pub unsafe fn add_attribute_decl(
    dtd: *mut _xmlDtd,
    elem: *mut _xmlElement,
    name: *const xmlChar,
    type_: c_int,
    def: c_int,
    defaultValue: *const xmlChar,
    tree: *mut _xmlEnumeration,
) -> *mut _xmlAttribute
Expand description

Add an attribute declaration to a DTD.

§UPSTREAM-PARITY

xmlAttributePtr xmlAddAttributeDecl(xmlDtdPtr dtd, xmlElementPtr elem,
                                    const xmlChar *name, int type, int def,
                                    const xmlChar *defaultValue,
                                    xmlEnumerationPtr tree);

Adds an attribute declaration to both the DTD’s attribute hash table (keyed by element name + attribute name) and the element’s linked list. If an attribute with the same name already exists for this element, the existing declaration is returned.

§SAFETY

  • dtd must be a valid pointer to an _xmlDtd, or NULL.
  • name must be a valid null-terminated string.
  • elem, defaultValue, tree may be NULL.