XML parsing: unbound prefix error

My XML Code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<EditText xlmns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/field"
android:layout_width="fill_parent"
androud:layout_height="fill_parent"
android:sineLine="false"
/>
</LinearLayout>

      

What's bad about it? Error: XML parsing error: Unbound prefix appears!

+1


source to share


1 answer


I see two typos:

  • You marked xmlns

    as xlmns

    in the item EditText

    .
  • The penultimate prefix usage android

    is writtenandroud

The following snippet fixes both problems:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <EditText xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/field" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:sineLine="false" />
</LinearLayout>

      

On a related note, consider using a tool that provides the best error reporting. These typos were evident with the tool I used to validate your XML (RAD 7.5.5.3):

  • The "androud" prefix for the "androud: layout_height" attribute associated with the "EditText" element type is not associated.
  • The "xlmns" prefix for the "xlmns: android" attribute associated with the "EditText" element type is not associated.
+4


source







All Articles