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);
                }

  • 相关阅读:
    AAC-LC 是什么格式?和 AAC 有什么区别?
    AAC_LC用LATM封装header信息解析 Audio Specific Config格式分析
    AAC的AudioSpecificConfig细节
    AAC帧格式及编码介绍
    AAC 格式分析
    AAC头部格式,RTP打包格式
    RTP 打包H264与AAC
    程序员除了会CRUD之外,还应该知道什么叫CQRS!
    Neo4j数据库学习一:安装和数据类型常用命令简介
    【Neo4j查询优化系列】如何快速统计节点的关系数
  • 原文地址:https://www.cnblogs.com/qqzy168/p/2665108.html
Copyright © 2011-2022 走看看