小編給大家分享一下XML文件要有根標(biāo)簽的案例,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

使用的xml文檔如下
<?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>問題所在:沒有加根標(biāo)簽呀!XML文件只能有一個根標(biāo)簽!
把xml改成下面這樣就ok了,也就是加一個Document標(biāo)簽,將先前的兩個根標(biāo)簽SearchConstraints和StoPList都放到Document標(biāo)簽的下面,從而整個XML文件只有一個根標(biāo)簽。
<?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文件要有根標(biāo)簽的案例的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
本文名稱:XML文件要有根標(biāo)簽的案例-創(chuàng)新互聯(lián)
本文路徑:http://www.chinadenli.net/article8/djhpip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、手機(jī)網(wǎng)站建設(shè)、響應(yīng)式網(wǎng)站、移動網(wǎng)站建設(shè)、全網(wǎng)營銷推廣、域名注冊
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容