Skip to content

explore using libxml2's xmlReconciliateNs() to deal with reparenting #2919

Open
@flavorjones

Description

@flavorjones

Currently Nokogiri tries to figure out namespaces after node reparenting via our homebrewed function node.c:relink_namespace(), however what we're doing there is probably not quite right as evidenced by the number of issues as well as the commentary on a few PRs, notably #2495 and #2310.

Recently I discovered that libxml2 has a method, xmlReconciliateNs(), which seems to do what we want (from a brief reading).

This issue is to explore using xmlReconciliateNs() with careful attention paid to:

  • does this fix some of the issues reported
  • does this break existing tests
  • does this break downstream consumers of Nokogiri

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions