What is the fastest way to combine two xml files into one

后端 未结 11 1545
广开言路
广开言路 2020-11-29 01:43

If I have two string of xml1 and xml2 which both represent xml in the same format. What is the fastest way to combine these together? The format is not important, but I ju

11条回答
  •  [愿得一人]
    2020-11-29 02:22

    You have two basic options:

    1. Parse the xml, combine the data structures, serialize back to xml.

    2. If you know the structure, use some basic string manipulation to hack it. For example, in the example above you could take the inside of allnodes in the two xml blocks and put them in a single allnodes block and be done.

提交回复
热议问题