Why can I not remove a child element I've just found? NOT_FOUND_ERR

后端 未结 4 1614
滥情空心
滥情空心 2021-01-07 20:20

I\'m building a script which has to patch XML files, including replacing one list of elements with another. The following function applies a patch (involving a possibly empt

4条回答
  •  一向
    一向 (楼主)
    2021-01-07 20:32

    parent.removeChild(node) is throwing a NOT_FOUND_ERR because node is not a child of parent. I see that node comes from getElementsByTagName which might not be an immediate child of parent. It could be anywhere under parent.

提交回复
热议问题