package com.xjgs.xmlParseVO; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; public class XmlFirstPage { public XmlFirstPage() { this.CaseCaption = new xmlBase(); this.BasiInfor = new xmlBasiInfor(); this.DiagInfor = new xmlDiagInfor(); this.ThirClassExa = new xmlThirClassExa(); this.SurgInfor = new xmlSurgInfor(); this.InfantCard = new xmlInfantCard(); this.TumTreatTab = new xmlTumTreatTab(); this.ExpenInfo= new xmlExpenInfo(); this.eprhead = new xmleprhead(); this.signatorys = new xmlsignatorys(); this.master = new xmlmaster(); this.Diags = new xmlDiags(); } public XmlFirstPage(String xmlStr) throws UnsupportedEncodingException, DocumentException { SAXReader saxreader=new SAXReader(); String xlStr=xmlStr; InputStream is = new ByteArrayInputStream(xlStr.getBytes("UTF-8")); Document doc =saxreader.read(is); Element root = doc.getRootElement(); this.CaseCaption = new xmlBase(root.element("CaseCaption")); this.BasiInfor = new xmlBasiInfor(root.element("BasiInfor")); this.DiagInfor = new xmlDiagInfor(root.element("DiagInfor")); this.ThirClassExa = new xmlThirClassExa(root.element("ThirClassExa")); this.SurgInfor = new xmlSurgInfor(root.element("SurgInfor")); this.InfantCard = new xmlInfantCard(root.element("InfantCard")); this.TumTreatTab = new xmlTumTreatTab(root.element("TumTreatTab")); this.ExpenInfo= new xmlExpenInfo(root.element("ExpenInfo")); this.eprhead = new xmleprhead(root.element("eprhead")); this.signatorys = new xmlsignatorys(root.element("signatorys")); this.master = new xmlmaster(root.element("master")); this.Diags = new xmlDiags(root.element("Diags")); } //属性 public xmlBase CaseCaption; public xmlBasiInfor BasiInfor; public xmlDiagInfor DiagInfor; public xmlThirClassExa ThirClassExa; public xmlSurgInfor SurgInfor; public xmlInfantCard InfantCard; public xmlTumTreatTab TumTreatTab; public xmlExpenInfo ExpenInfo; public xmleprhead eprhead; public xmlsignatorys signatorys; public xmlmaster master; public xmlDiags Diags; }