XmlAttributeIterator

import { XmlAttributeIterator } from "jsr:@ende/xml";

interface

interface XmlAttributeIterator

Reusable attribute accessor that avoids allocating attribute object arrays.

Instead of creating an array of attribute objects, attributes are accessed by index through this interface. The implementation reuses internal arrays across elements.

Properties

count

readonly count: number

The number of attributes.

Methods

getName

getName(index: number): string

Get the raw attribute name at the given index.

getValue

getValue(index: number): string

Get the decoded attribute value at the given index.

getColonIndex

getColonIndex(index: number): number

Get the colon index in the attribute name (-1 if no namespace prefix). This allows consumers to parse namespace prefixes without string allocation.

getUri

getUri(index: number): string | undefined

Get the resolved namespace URI for the attribute at the given index. Returns undefined if the attribute has no namespace prefix or the prefix is not bound (xmlns: attributes always return undefined as they declare rather than use namespaces).

Source