创建 DOM 节点列表
我正在实现 ECMA-357 附件 A 中描述的所有可选 E4X 功能,但在实现 domNodeList(§A.1.2 和 §A.2.2)时遇到问题。我如何创建自己的 NodeList 对象?
即使我创建一个新的 XMLDocument 并将节点的每个 domNode() 表示形式附加到 XMLList 中,我仍然不知道如何创建一个包含所有内容的 NodeList,因为注释和处理指令通常被排除在外。
I'm implementing all of the optional E4X features described in ECMA-357 Annex A and I'm having trouble implementing domNodeList (§A.1.2 and §A.2.2). How would I create my own NodeList object?
Even if I create a new XMLDocument and append every domNode() representation of the nodes in an XMLList, I still don't see how I could create a NodeList containing everything as comments and processing instructions are usually excluded.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现我可以使用文档片段的 childNodes 属性来创建 NodeList。这是我的解决方案:
I figured out that I could use the childNodes attribute of a document fragment to create a NodeList. This was my solution: