document dws; try { dws = xmlfactory.getresource("/com/newzhongway/service/test.xml"); extdocument ext= new extdocument(dws); string rexml = xmlfactory.getxmlstr(dws); string jsonstr = xml2jsonutil.xml2json(rexml); } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); }
myclipse errors in console
org.jdom.input.jdomparseexception: error on line 0: encoding "gbk" not supported. @ org.jdom.input.saxbuilder.build(saxbuilder.java:533) @ org.jdom.input.saxbuilder.build(saxbuilder.java:865) @ com.zhongway.pub.handler.xml2jsonutil.xml2json(xml2jsonutil.java:30) @ com.zhongway.pub.handler.xml2jsonutil.main(xml2jsonutil.java:214) caused by: org.xml.sax.saxparseexception: encoding "gbk" not supported. @ org.apache.xerces.framework.xmlparser.reporterror(xmlparser.java:1196) @ org.apache.xerces.readers.defaultentityhandler.startreadingfromdocument(defaultentityhandler.java:541) @ org.apache.xerces.framework.xmlparser.parsesomesetup(xmlparser.java:312) @ org.apache.xerces.framework.xmlparser.parse(xmlparser.java:1080) @ org.jdom.input.saxbuilder.build(saxbuilder.java:518) ... 3 more
my xml file
<?xml version='1.0' encoding='gb2312'?> <interfacemsg> <query> <sheetno>2015080700001</sheetno> <dealer>keda</dealer> <prov>sn_eoms</prov> </query> <result> <sheetdetailinfo> <basicinfo> <wsid>2015080700001</wsid> <wstypecode>移动专业故障</wstypecode> <wsinfohint>移动网:cdma网;故障对象:测试</wsinfohint> <begintime>2015-08-07 08:45:01</begintime> <endtime></endtime> <status>受理派单</status> <urgedegree>一般</urgedegree> <pasttime>4734</pasttime> </basicinfo> <handleinfolist> <handleinfo> <taskname>申告工单</taskname> <taskcreatetime>2015-08-07 08:45:01</taskcreatetime> <handleperson>keda</handleperson> <taskreceivetime></taskreceivetime> <handletime>2015-08-07 08:45:02</handletime> <handledetail></handledetail> </handleinfo> <handleinfo> <taskname>受理派单</taskname> <taskcreatetime>2015-08-07 08:45:01</taskcreatetime> <handleperson></handleperson> <taskreceivetime></taskreceivetime> <handletime></handletime> <handledetail></handledetail> </handleinfo> </handleinfolist> <applyinfo> <custtype></custtype> <applyer>keda</applyer> <applytime>2015-08-07 08:45:00</applytime> <applyunit>科大恒星</applyunit> <troubleobj>测试</troubleobj> <network>cdma网</network> <applyclass>国内漫游</applyclass> <applyclasssmall>语音业务</applyclasssmall> <troubledescr>测试</troubledescr> <ccfxhjdcl>初步分析处理</ccfxhjdcl> <ifinflbusi>否</ifinflbusi> <happentime>2015-08-07 03:00:00</happentime> <iffirstfound>是</iffirstfound> <troublesource>其他</troublesource> <timelimit></timelimit> <custlevel></custlevel> <gecustclass></gecustclass> <custindus></custindus> <custsl></custsl> <custlocal></custlocal> <othercustinfo></othercustinfo> <additionalremark></additionalremark> <roamingtype></roamingtype> <roamingcountry></roamingcountry> <imsi></imsi> <custname></custname> </applyinfo> <dispatchinfolist/> <dealinfolist/> <hangupinfolist/> <callcenterinfolist/> <attachinfolist/> <oplist/> </sheetdetailinfo> <returnval> <return_code>0</return_code> <return_desc>完成</return_desc> </returnval> </result> </interfacemsg>
but why have error? can me out wrong code. searching long time on net. no use. please or try give ideas how achieve this
Comments
Post a Comment