• Sets attributes of the xlink namespace for the given element.

    Attributes already set before will be overwritten.

    This method is typically used in toData mapping.

    Parameters

    • element: Element

      the elemant to set the attributes at

    • attributes: Partial<Record<string, string>>

      the key-value pairs of attributes to set

    • allowEmpty: boolean = true

      if to ignore entries with empty values or not; default: true

    Returns void

    Example

    setXLinkAttributes(element, {
    // empty: Ignored, if allowEmpty=false
    "title": "",
    "href": "https://example.org/"
    });