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
XmlNodewraps a raw C pointer to an underlying libxml2 struct. Because of this, multipleXmlNodeinstances 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: