2013-11-27 53 views
4

我收到錯誤獲得一個實體名稱必須緊跟在「&」 Java中的實體引用錯誤,但我沒有在我的XML文件中的任何與符號

The entity name must immediately follow the '&' in the entity reference. 

但我不在我的XML文檔中有任何&符號!有誰知道爲什麼會發生這種情況?這裏是我試圖解析的XML文檔:

<rss version= "2.0" > 
<channel> 
<item> 
<title>Best iPad strategy games</title> 
<link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/198mhX3FVmw/story01.htm</link>   </item> 
<item> 
<title>Share your life with friends in real time with Spin</title> 
<link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/9G84sETG_9I/story01.htm</link> </item> 
<item> 
<title>How to stop receiving notifications from a website in OS X Mavericks</title> 
<link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/IyxFbLcmoOE/story01.htm</link> </item> 
<item> 
<title>iPad mini with Retina Display hitting resellers in the UK, 4G LTE models still  look scarce</title> 
<link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/FGTUITMMR0E/story01.htm</link> </item> 
<item> 
<title>Procraster for iPhone helps you fight procrastination and break down large projects</title> 
<link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/o5ATGmzDthw/story01.htm</link></item> 
<item><title>Pad & Quill brings ages-old craftsmanship to all new leather bags and sleeves</title>  <link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/NJzAu_PyQNo/story01.htm</link></item> 
<item><title>BillGuard 4.0 for iPhone brings spending analytics, savings alerts, and more</title> <link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/HY4zCH7l1QM/story01.htm</link></item> 
<item><title>GTA: San Andreas coming to iOS in December, game controller support in tow</title><link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/SVNSBiViJdk/story01.htm</link></item> 
<item><title>QuizUp developer Plain Vanilla fixes server issues that left user data vulnerable</title><link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/Nzhq0f5O3Ns/story01.htm</link></item> 
<item><title>Iterate 58: Paul Haddad on Tweetbot 3</title><link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/XJ4dCJWZFVo/story01.htm</link></item> 
<\item><title>Deal of the Day: Incipio EDGE PRO Hard Shell Slider Case for iPhone 5S</title><link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/ypt-j2OBqOM/story01.htm</link></item> 
<item><title>Moshi Ionbank 10k battery pack review: Good looks and plenty of power</title> <link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/0HUTAMqX82k/story01.htm</link></item> 
<item><title>Infinity Blade goes free for Black Friday week</title> <link>http://feedproxy.google.com/~r/TheIphoneBlog/~3/q0XdepWSTiM/story01.htm</link></item> <item><title>Procreate 2 for iPad now available, adds 64-bit, iOS 7 design, new GPU accelerated filters, and more</title> 
</channel></rss> 

在此先感謝您的幫助!

+0

有您的文檔(至少一個)在&符號來代替和'<\item>'肯定是錯的。使用適當的編輯器(例如帶有XML插件的Notepad ++)來發現這種錯誤。 –

回答

26

是的,你確實有一個符號:

<item><title>Pad & Quill 

嘗試

<item><title>Pad &amp; Quill 

而且,這可能是一個錯字:<\item><title>Deal of the Day,您可以通過刪除反斜槓糾正。 ;

+0

其工作......非常感謝 –

+0

我有一個類似的問題,我用&替換'&' –

2

在string.xml

每個符號應該由

&amp; 
相關問題