标签:created odi pre key element 通过 get logger ring
1 public String packageYDImageUploadXML(String versionCode, Map parmsMap) throws ParseException { 2 Document document = DocumentHelper.createDocument(); 3 document.setXMLEncoding("UTF-8"); 4 Element root = document.addElement("scybinput"); //root node 5 try { 6 //inidentity node 7 Element inidentity = root.addElement("inidentity"); 8 //inidentity content 9 inidentity.addElement("version").addText(versionCode); 10 inidentity.addElement("baa008").addText(SettingUtil.getValue(Setting.Key.YB_TCQ_CODE)); 11 inidentity.addElement("baa010").addText(SettingUtil.getValue(Setting.Key.YB_JYD_CODE)); 12 inidentity.addElement("akb020").addText(SettingUtil.getValue(Setting.Key.YB_HOSPITAL_CODE)); 13 inidentity.addElement("akb021").addText(SettingUtil.getValue(Setting.Key.COMMON_HOSPITAL_NAME)); 14 15 //inbusinesscontent node 16 Element inbusinesscontent = root.addElement("inbusinesscontent"); 17 //inbusinesscontent content 18 Iterator iterator = parmsMap.entrySet().iterator(); 19 while (iterator.hasNext()) { 20 Map.Entry<String, String> entry = (Map.Entry<String, String>) iterator.next(); 21 if (entry.getValue() != null) { 22 inbusinesscontent.addElement(entry.getKey()).addText(String.valueOf(entry.getValue())); 23 }else { 24 inbusinesscontent.addElement(entry.getKey()); 25 } 26 } 27 28 }catch (Exception e){ 29 getLogger().error("系统异常",e); 30 }finally { 31 return document.asXML(); //inputXml 32 } 33 }
将Map中的参数提取出来,通过Docment封装为XML.
标签:created odi pre key element 通过 get logger ring
原文地址:http://www.cnblogs.com/jjlyx/p/7498383.html