XML文件要有根标签(Extra content at the end of the document in file 错误)

使用的xml文档如下

 

 

[html]  view plain  copy
 
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2.   <SearchConstraints>  
  3.     <Begin>glucose</Begin>  
  4.     <End>Ethanol</End>  
  5.     <Interface>name</Interface>  
  6.     <IntermediatesInclude number="0"></IntermediatesInclude>  
  7.     <IntermediatesExclude> number="0"></IntermediatesExclude>  
  8.     <Organisms type="all"></Organisms>  
  9.     <KShort>10</KShort>  
  10.   </SearchConstraints>  
  11.   <StoPList>  
  12.     <StoP>  
  13.       <Source id="glucose"></Source>  
  14.       <Target id="Ethanol"></Target>  
  15.       <RouteList>  
  16.       </RouteList>  
  17.     </StoP>  
  18.   </StoPList>  


问题所在:没有加根标签呀!XML文件只能有一个根标签
把xml改成下面这样就ok了,也就是加一个Document标签,将先前的两个根标签SearchConstraints和StoPList都放到Document标签的下面,从而整个XML文件只有一个根标签

 

 

[html]  view plain  copy
 
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <Document>  
  3.   <SearchConstraints>  
  4.     <Begin>glucose</Begin>  
  5.     <End>Ethanol</End>  
  6.     <Interface>name</Interface>  
  7.     <IntermediatesInclude number="0"></IntermediatesInclude>  
  8.     <IntermediatesExclude> number="0"></IntermediatesExclude>  
  9.     <Organisms type="all"></Organisms>  
  10.     <KShort>10</KShort>  
  11.   </SearchConstraints>  
  12.   <StoPList>  
  13.     <StoP>  
  14.       <Source id="glucose"></Source>  
  15.       <Target id="Ethanol"></Target>  
  16.       <RouteList>  
  17.       </RouteList>  
  18.     </StoP>  
  19.   </StoPList>  
  20. </Document>  
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值