//获取单个节点文本内容
            String total = doc.selectSingleNode("/message/body/params/total").getText();

//获取xml循环消息体
            List<Node> beannodes = doc.selectNodes("/message/body/paramlist/bean");
           
            Eperson[] epersonList = new Eperson[beannodes.size()];
           
            for (int i = 0; i < beannodes.size(); i++)
            {
                Eperson eperson = new Eperson();
                //有node节点再获取单个节点文本内容
                String staffid = beannodes.get(i).selectSingleNode("./staffno").getText();
                String name = beannodes.get(i).selectSingleNode("./name").getText();
                String staffaccount = beannodes.get(i).selectSingleNode("./staffaccount").getText();
                String staffno = beannodes.get(i).selectSingleNode("./staffno").getText();
                String sex = beannodes.get(i).selectSingleNode("./sex").getText();
                String mobile = beannodes.get(i).selectSingleNode("./mobile").getText();
                String homephone = beannodes.get(i).selectSingleNode("./homephone").getText();
                String fax = beannodes.get(i).selectSingleNode("./fax").getText();
                String email = beannodes.get(i).selectSingleNode("./email").getText();
                String bindno = beannodes.get(i).selectSingleNode("./bindno").getText();
                String shortphone = beannodes.get(i).selectSingleNode("./shortphone").getText();
                String officephone = beannodes.get(i).selectSingleNode("./officephone").getText();
               
                String credit = beannodes.get(i).selectSingleNode("./credit").getText();
                ;
                String underWrite = beannodes.get(i).selectSingleNode("./underwrite").getText();
                ;
                String voip = beannodes.get(i).selectSingleNode("./voip").getText();
                ;
                String addr = beannodes.get(i).selectSingleNode("./addr").getText();
                ;
                String otherPhone = beannodes.get(i).selectSingleNode("./otherphone").getText();
                ;
                String zip = beannodes.get(i).selectSingleNode("./zip").getText();
                ;
                String seat = beannodes.get(i).selectSingleNode("./seat").getText();
                ;
               
                eperson.setStaffid(staffid);
                eperson.setName(name);
                eperson.setStaffaccount(staffaccount);
                eperson.setStaffno(staffno);
                eperson.setSex(sex);
                eperson.setMobile(mobile);
                eperson.setHomephone(homephone);
                eperson.setFax(fax);
                eperson.setEmail(staffaccount + Configuration.getInstance().getEmailTail());
                eperson.setBindno(bindno);
                eperson.setShortphone(shortphone);
                eperson.setOfficephone(officephone);
               
                eperson.setCredit(credit);
                eperson.setUnderWrite(underWrite);
                eperson.setVoip(voip);
                eperson.setAddr(addr);
                eperson.setOtherPhone(otherPhone);
                eperson.setZip(zip);
                eperson.setSeat(seat);
                epersonList[i] = eperson;
                epersonBean.setEpersonList(epersonList);
            }

相关文章:

  • 2021-04-21
  • 2019-11-13
  • 2022-02-24
  • 2021-12-31
  • 2022-12-23
  • 2021-11-14
  • 2021-11-04
猜你喜欢
  • 2022-02-26
  • 2021-12-05
  • 2021-07-25
  • 2021-07-19
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
相关资源
相似解决方案