Skip to content

XML: improve the DOM interface #15915

Open
@ysbaddaden

Description

@ysbaddaden

There are a number of shortcomings in the XML DOM interface:

  1. Something annoying is that every method to navigate the DOM tree return a nilable: #first_element_child, #next, #parent, ... This is in stark contrast with the rest of the stdlib API, where methods expect the value to exist and raise otherwise, with a question mark alternative method to return a nilable, for example #parent vs #parent?.

    That would be a breaking change, but it would make the API easier and in par with the rest of the stdlib.

  2. There are no means to mutate the DOM, apart for the isolated #unlink... that follows the libxml naming instead of the DOM spec by-the-way (it should be named #remove). We should be able to create, if not whole documents, at least nodes and fragments, and to append and insert nodes wherever.

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