export type XmlNodeType = 'document' | 'element' | 'text' | 'cdata' | 'comment' | 'processingInstruction' | 'doctype' | 'attribute'; export declare abstract class XmlNode { abstract readonly nodeType: XmlNodeType; parent: XmlElement | XmlDocument | null; abstract toString(): string; /** Walk the tree depth-first, calling visitor for each node. */ walk(visitor: (node: XmlNode) => void): void; } export declare class XmlAttribute { readonly nodeType: XmlNodeType; name: string; value: string; prefix: string; localName: string; namespaceURI: string; constructor(name: string, value: string, namespaceURI?: string); toString(): string; } export declare class XmlText extends XmlNode { readonly nodeType: XmlNodeType; value: string; constructor(value: string); toString(): string; } export declare class XmlCData extends XmlNode { readonly nodeType: XmlNodeType; value: string; constructor(value: string); toString(): string; } export declare class XmlComment extends XmlNode { readonly nodeType: XmlNodeType; value: string; constructor(value: string); toString(): string; } export declare class XmlProcessingInstruction extends XmlNode { readonly nodeType: XmlNodeType; target: string; data: string; constructor(target: string, data: string); toString(): string; } export declare class XmlDoctype extends XmlNode { readonly nodeType: XmlNodeType; content: string; constructor(content: string); toString(): string; } export declare class XmlElement extends XmlNode { readonly nodeType: XmlNodeType; tagName: string; prefix: string; localName: string; namespaceURI: string; attributes: Map; children: XmlNode[]; /** G2: 1-based source line of this element's open tag (undefined if not tracked) */ sourceLine?: number; /** G2: 1-based source column of this element's open tag (undefined if not tracked) */ sourceCol?: number; /** * G10: The xml:id value of this element, if present. * xml:id values are unique per document — the parser enforces this. */ xmlId?: string; /** * G10: The effective xml:base URI for this element, resolved from the * nearest ancestor xml:base attribute (or the element's own xml:base). */ xmlBase?: string; constructor(tagName: string, namespaceURI?: string); getAttribute(name: string): string | null; setAttribute(name: string, value: string, ns?: string): void; hasAttribute(name: string): boolean; removeAttribute(name: string): void; appendChild(node: XmlNode): void; /** Returns only element children */ get childElements(): XmlElement[]; /** Returns the concatenated text content of all text / cdata children */ get textContent(): string; /** Find first child element by local name */ getChild(localName: string): XmlElement | null; /** Find all child elements by local name */ getChildren(localName: string): XmlElement[]; /** * Find elements by a simple path (slash-separated local names). * e.g. element.find('body/section/title') */ find(path: string): XmlElement | null; findAll(path: string): XmlElement[]; walk(visitor: (node: XmlNode) => void): void; toString(indent?: number): string; } export declare class XmlDocument extends XmlNode { readonly nodeType: XmlNodeType; readonly children: XmlNode[]; encoding: string; version: string; standalone: boolean | null; /** * G10: Map of xml:id value → element, built during parsing. * Used for quick lookup by ID and for uniqueness enforcement. */ xmlIds: Map; /** The root element */ get root(): XmlElement | null; appendChild(node: XmlNode): void; walk(visitor: (node: XmlNode) => void): void; toString(): string; } //# sourceMappingURL=XmlNodes.d.ts.map