有了這個小XML文件,我得到的錯誤年底額外的內容(記事本++ - 插件「XML工具」):XML文件 - 在文檔
XML Parsing error at line 5:
Extra content at the end of the document
文件看起來像這樣:
<?xml version="1.0" encoding="UTF-8"?>
<fields>
<var10DInterestRisk>
<1439769600>17.17</1439769600>
<1444003200>16.58</1444003200>
<1440979200>18.4</1440979200>
<1437955200>16.69</1437955200>
<1442188800>17.48</1442188800>
<1439164800>16.02</1439164800>
<1443398400>18.7</1443398400>
<1440374400>18.26</1440374400>
<1437350400>17.22</1437350400>
<1441584000>16.16</1441584000>
<1438560000>15.35</1438560000>
<1442793600>19.21</1442793600>
</var10DInterestRisk>
<gamma>0.053588957997224</gamma>
<issuerProductType>MassIssuanceVanillaWarrant_Equity Warrant</issuerProductType>
<lastTradingDate>2016-12-15</lastTradingDate>
</fields>
我找不到原因..:/你能幫我嗎?
謝謝!
我不知道爲什麼你會得到*那*錯誤,當我通過lint運行該代碼時,我得到'4:解析器錯誤:StartTag:無效元素名稱 <1439769600> 17.171439769600>' – Quentin
何時/何處到達你得到這個錯誤? (我知道notepad ++只是作爲一個文本編輯器,所以打開/編輯這個文件應該沒有問題) – TobiMarg
順便說一句,如果你想製作一個最小再現器(或自己修復這個問題!),你會開始從文件中取出內容,並看到它何時停止*產生相同的錯誤。這將通過縮減過程清楚地表明它是帶有數字名稱的元素導致了您的問題。 –