2012-12-16 55 views
0

嗨我的我的android應用程序的XML文件有問題。它吐出這個錯誤Android Xml數據庫

錯誤:無效的開始標籤類別。 。 。這裏是源代碼。

<?xml version="1.0" encoding="UTF-8" ?> 
<Category> 
<destination id="1" main_cat="Hotel"> 
     <timestamp></timestamp> 
     <business_name><![CDATA[ Sugarland Hotel ]]></business_name> 
     <alias><![CDATA[ Sugarland Hotel ]]></alias> 
     <address><![CDATA[ Araneta Avenue ]]></address> 
     <city><![CDATA[ Bacolod ]]></city> 
     <subcategory><![CDATA[ Hotel ]]></subcategory> 
     <cuisine><![CDATA[ Italian,Asian ]]></cuisine> 
     <budget> </budget> 
     <features> </features> 
     <working_days><![CDATA[ Everyday ]]></working_days> 
     <opening><![CDATA[ 24/7 ]]></opening> 
     <ending> </ending> 
     <contact><![CDATA[ (34)435-2690 , (34)435-2780 ]]></contact> 
     <fax><![CDATA[ (34)435-2645 ]]></fax> 
     <email><![CDATA[ [email protected] ]]></email> 
     <website><![CDATA[ www.sugarlandhotel.com ]]></website> 
     <payment_type><![CDATA[ cash,credit card,master card, visa ]]></payment_type> 
     <lat><![CDATA[ 10.6524789N ]]></lat> 
     <long><![CDATA[ 122.9372838E ]]></long> 
     <desc><![CDATA[ Experience a modern hacienda retreat that nurtures the charm and romance of old world plantation living. Extensively renovated beginning 2010, Sugarland hotel unvails a celebrated balance of nostalgia and contemporary style, Capturing its original southern elegence, luxury, and decadence. Machuca tiles form cool geometric patterns in the hallways. Hacienda hardwoord floors contrast modern furnishings and amenities in the dramatic suits. The sugarland lifestyle offers guests the finest sensory indulgences: signature hacienda service, soothing organic toiletries, heirloom recipes, and unmatched privacy and tranquility. ]]></desc> 
     <image>  </image> 
</destination> 
    </Category> 

還我試圖測試CDATA我寧願用它或XML模式去。感謝您的幫助提前

回答

0

刪除<?xml version="1.0" encoding="UTF-8" ?>前面的空格。 沒有什麼可以出現在它之前。

IntelliJ和我的瀏覽器都說你的XML很好。一定還有其他的錯誤。

+0

對不起,它在我的代碼中發佈的錯誤沒有空白。 –

+0

是啊我也嘗試從一個XML驗證程序我的XML沒有錯誤。 。 idk爲什麼我的android應用程序失敗。 –

+0

如果我正確讀取,Android正在使用內置於Java中的SAX和DOM解析器。那些工作正常,所以這是你正在做的其他事情。 – duffymo