开发者

error: Error parsing XML: unbound prefix

开发者 https://www.devze.com 2023-03-25 00:01 出处:网络
I have gotten this error in the strings.xml file: error: Error parsing XML: unbound prefix <resources>

I have gotten this error in the strings.xml file: error: Error parsing XML: unbound prefix

<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 A开发者_如何转开发vailable 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>

What Am i doing something wrong???


You don't have an XML namespace defined for <xliff:g id="device_name">%1$s</xliff:g>

In reality you're going to want to escape the < > around the xliff:g tags. The text inside the <string> tags is being handled as raw XML instead of as part of the string value.

Use this instead for the title_connected_to entry:

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


You are using the wrong opening tag for <resources>. Change <resources> to <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2> and then use the regular closing tag


The third one under BluetoothChat has 'Error:' written next to it. Is that what's causing the error, or did you add that to show which line was causing the error?


You need <?xml version="1.0" encoding="utf-8"?> before the resources tag

0

精彩评论

暂无评论...
验证码 换一张
取 消