1

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 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>

What Am i doing something wrong???

YoKaGe
  • 385
  • 2
  • 7
  • 15

4 Answers4

7

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>

serenesat
  • 4,611
  • 10
  • 37
  • 53
Jason
  • 1,086
  • 5
  • 10
  • device_name is defined in a seprate xml file – YoKaGe Aug 02 '11 at 21:05
  • device_name.xml: – YoKaGe Aug 02 '11 at 21:06
  • OK, but you don't define that namespace in the resources file. I'm not familiar with the way you're trying to refer to device_name, but from an XML parser point of view, that is why the XML you're providing is not valid. – Jason Aug 02 '11 at 22:20
3

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

Roney Thomas
  • 1,371
  • 1
  • 9
  • 11
1

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?

Pikaling
  • 8,282
  • 3
  • 27
  • 44
1

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

Ashterothi
  • 3,282
  • 1
  • 21
  • 35