@federicocarboni/saxe
    Preparing search index...

    Interface NamespaceAttributes

    An immutable namespace-aware collection of the attributes of an XML tag.

    interface NamespaceAttributes {
        size: number;
        "[iterator]"(): IterableIterator<[QName, string]>;
        entries(): IterableIterator<[QName, string]>;
        forEach(
            callbackfn: (
                value: string,
                name: QName,
                attributes: NamespaceAttributes,
            ) => void,
            thisArg?: unknown,
        ): void;
        get(localName: string, namespace?: string): string | undefined;
        has(localName: string, namespace?: string): boolean;
        keys(): IterableIterator<QName>;
        values(): IterableIterator<string>;
    }
    Index

    Properties

    size: number

    The number of attributes.

    Methods

    • Returns IterableIterator<[QName, string]>

      • Returns an iterator over the names and values of the attributes.
    • Executes callbackfn for each attribute.

      Parameters

      Returns void

    • Returns the value of the attribute from its local name and namespace.

      // ✘ Qualified name is not supported
      attributes.get("xml:lang")
      // ✔ Namespaced attribute
      attributes.get("lang", XML_NAMESPACE)
      // ✔ No namespace
      attributes.get("href")

      Parameters

      • localName: string

        Local name of the attribute. Qualified names are not supported.

      • Optionalnamespace: string

        Namespace URI for attributes with a namespace.

      Returns string | undefined

      • Returns the value of the attribute with the specified name and namespace. If there is no attribute with the specified name and namespace undefined is returned.
    • Returns true if the specified attribute is present, false otherwise.

      Parameters

      • localName: string

        Local name of the attribute.

      • Optionalnamespace: string

        Namespace URI for attributes with a namespace.

      Returns boolean

      • Returns a boolean value indicating whether an attribute with the specified name and namespace is present.
    • Returns IterableIterator<QName>

      • Returns an iterator over the names of the attributes.
    • Returns IterableIterator<string>

      • Returns an iterator over the values of the attributes.