2011-08-02 12 views
1

私はのstrings.xmlファイル内でこのエラーを得ているエラーは、XMLの解析:私は何かを間違って何をやっている未結合の接頭エラー:エラーXML解析:エラー:バインドされていない接頭辞

<resources> 
    <string name="mainTitle">Remote Doctor </string> 
    <string name="app_name">Remote Doctor</string> 
    <string name="patientButton">Patient Mode </string> 
    <string name="doctorButton">Doctor Mode </string> 
    <string name="aboutButton">About </string> 
    <string name="exit">Exit</string> 
    <string name="simpleMode">Simple Mode</string> 
    <string name="detailedMode">Detailed Mode</string> 
    <string name="aboutTitle">About Remote Doc</string> 
    <string name="aboutText">\ 
    Remote Doc is an application that allows a brace user and the doctor to analyze and record 
    how often the brace is being worn and how much force or pressure the brace is putting on 
    the user  </string> 

    <!-- BluetoothChat -->  
    <string name="send">Send</string>  
    <string name="not_connected">You are not connected to a device</string>  
Error: <string name="bt_not_enabled_leaving">Bluetooth was not enabled. Leaving Bluetooth Chat.</string>  
    <string name="title_connecting">connecting...</string>  
    <string name="title_connected_to">connected to <xliff:g id="device_name">%1$s</xliff:g></string>  
    <string name="title_not_connected">not connected</string>  
    <!-- DeviceListActivity -->  
    <string name="scanning">scanning for devices...</string>  
    <string name="select_device">select a device to connect</string>  
    <string name="none_paired">No devices have been paired</string>  
    <string name="none_found">No devices found</string>  
    <string name="title_paired_devices">Paired Devices</string>  
    <string name="title_other_devices">Other Available Devices</string>  
    <string name="button_scan">Scan for devices</string>  
    <!-- Options Menu -->  
    <string name="secure_connect">Connect a device - Secure</string>  
    <string name="insecure_connect">Connect a device - Insecure</string>  
    <string name="discoverable">Make discoverable</string> 
</resources> 

を?? ?

+3

はい、答えは「はい」です。 – jondavidjohn

+0

この投稿をチェックアウト:http://stackoverflow.com/questions/2221221/frequent-problem-in-android-view-error-parsing-xml-unbound-prefix –

答えて

7

あなたはxliff:gタグの周り< >を脱出したいとしている現実に<xliff:g id="device_name">%1$s</xliff:g>

用に定義されたXML名前空間を持っていません。 <string>タグ内のテキストは、文字列値の一部としてではなく、生のXMLとして処理されています。

<string name="title_connected_to">connected to &lt;xliff:g id="device_name"&gt;%1$s&lt;/xliff:g&gt;<string>

+0

device_nameが定義されているseprate xmlファイル – YoKaGe

+0

device_name.xml:<?xml version = "1.0" encoding = "utf-8"?> YoKaGe

+0

ただし、リソースファイルではその名前空間を定義しません。私はあなたがdevice_nameを参照しようとしている方法に慣れていませんが、XMLパーサの観点からは、提供しているXMLが有効でない理由です。 – Jason

1

BluetoothChatの下の3番目に「Error:」と書かれています。それがエラーの原因か、エラーを引き起こしている行を示すために追加しましたか?

+0

質問に含まれて – YoKaGe

1

あなたは<resources>のために間違った開始タグを使用しているリソースタグ

+0

私はすでにそれが質問に表示されていないtahtを持っている – YoKaGe

2

<?xml version="1.0" encoding="utf-8"?>が必要になります。これは代わりにtitle_connected_toエントリの

使用。 <resources><resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2>に変更してから通常の終了タグを使用してください。

関連する問題