g mainPart = srcString. substring(srcString. indexOf\r( " >" )+1,srcString. lastindexOf( "<" ));\r84. String sufix = srcString.substring(srcString.lastindexOf\r( " < ")) ;\r85. St ring addPa rt = appendString. substring (appendString. inde\rxof( " >" ) + 1, appendString. lastindexOf( "<" ));\r86.\r87. if (map != null && !map.isEmpty()) {\r88. // 对 xml 字符串中图片 ID 进行替换\r89. for (Map.Entry<String, String> set : map.entrySet\r()) {\r90. add Part = addPart. replace (set. get Key(), set. get Va\rlue());\r91. }\r92. }\r93. // 将两个文档的 xml 内容进行拼接\r94. CTBody makeBody = CTBody . Factory. parse(prefix+mainPart+ad\rdPart+sufix);\r95.\r96. src.set(makeBody);\r97. }\r98. }