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

后端 未结 11 1546
广开言路
广开言路 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:12

    Since you asked for the fastest:

    If (and only if) the xml structure is always consistent: (this is pseudo code)

    string xml1 = //get xml1 somehow
    string xml2 = //get xml2 somehow
    xml1 = replace(xml1, "", "");
    xml1 = replace(xml1, "", "");
    xml1 = replace(xml1, "", "");
    xml2 = replace(xml2, "", "\n" + xml1);
    

    It's a giant hack but it's fast. Expect to see it on TheDailyWTF when your colleagues find it.

提交回复
热议问题