XmlAttributeIterator
import { XmlAttributeIterator } from "jsr:@ende/xml";interface
interface XmlAttributeIteratorReusable 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: numberThe number of attributes.
Methods
getName
getName(index: number): stringGet the raw attribute name at the given index.
getValue
getValue(index: number): stringGet the decoded attribute value at the given index.
getColonIndex
getColonIndex(index: number): numberGet 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 | undefinedGet 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).