<?xml version="1.0" encoding="UTF-8"?> <SearchConstraints> <Begin>glucose</Begin> <End>Ethanol</End> <Interface>name</Interface> <IntermediatesInclude number="0"></IntermediatesInclude> <IntermediatesExclude> number="0"></IntermediatesExclude> <Organisms type="all"></Organisms> <KShort>10</KShort> </SearchConstraints> <StoPList> <StoP> <Source id="glucose"></Source> <Target id="Ethanol"></Target> <RouteList> </RouteList> </StoP> </StoPList>
问题所在:没有加根标签呀!XML文件只能有一个根标签!
把xml改成下面如许就ok了,也就是加一个Document标签,将先前的两个根标签SearchConstraints和StoPList都放到Document标签的下面,从而全部XML文件只要一个根标签。
<?xml version="1.0" encoding="UTF-8"?> <Document> <SearchConstraints> <Begin>glucose</Begin> <End>Ethanol</End> <Interface>name</Interface> <IntermediatesInclude number="0"></IntermediatesInclude> <IntermediatesExclude> number="0"></IntermediatesExclude> <Organisms type="all"></Organisms> <KShort>10</KShort> </SearchConstraints> <StoPList> <StoP> <Source id="glucose"></Source> <Target id="Ethanol"></Target> <RouteList> </RouteList> </StoP> </StoPList> </Document>
以上就是XML文件要有根标签(毛病)的代码处理分享的细致内容,更多请关注ki4网别的相干文章!