Splitting child node from XML file into their own XML files

前端 未结 2 1843
予麋鹿
予麋鹿 2020-12-21 20:40

I have an XML file (on the left) and I want to create multiple files (on the right):

                                  file1:
    

        
2条回答
  •  攒了一身酷
    2020-12-21 21:35

    Nodes in the DOM have a concept of their owning document (hence your WRONG_DOCUMENT_ERR).

    So you need to import the node from the original DOM to your new one. See Document.importNode()

提交回复
热议问题