zoukankan      html  css  js  c++  java
  • 解析xml的单个节点值和循环节点消息体

         //获取单个节点文本内容
                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);
                }

  • 相关阅读:
    H.264---(I、P、B帧)(I帧和IDR帧)(DTS和PTS、time_base)
    H.264---帧内预测编码和帧间预测编码
    H.264---编码架构分析
    视频编码技术---可分级视频编码
    Linux 进程通信
    mac 下使用 git && SourceTree
    mac 下安装 mongodb,Robommongodb
    mac 下 nginx的安装
    VPD(Virtual Private Database) 简单演示
    connect by prior start with
  • 原文地址:https://www.cnblogs.com/qqzy168/p/2665108.html
Copyright © 2011-2022 走看看