Skip to content

Add public API to check structural identity between XmlNode instances #148

@jameslan

Description

@jameslan

XmlNode wraps a raw C pointer to an underlying libxml2 struct. Because of this, multiple XmlNode instances can reference the same underlying node — but there's currently no clean way to check this without reaching into the internal pointer directly.

We should expose a public method (e.g. isSameNode(other: XmlNode): boolean) so callers can check structural identity without depending on implementation internals.

Example:

const a = doc.getNode(...)
const b = doc.getNode(...)

// Today — leaks internal details:
a._ptr === b._ptr

// Proposed:
a.isSameNode(b) // true

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions