user1091368
user1091368

Reputation: 359

What does "Error parsing XML: not well-formed" mean?

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

I get these two errors

error: Error parsing XML: not well-formed (invalid token)

&

Open quote is expected for attribute "android:orientation" associated with an element type "LinearLayout".

Upvotes: 0

Views: 3872

Answers (3)

Dave M
Dave M

Reputation: 1322

There are many references that explain the differences between valid and well formed XML documents. A good starting point can be found here. There is also an online XML Validator that you can use to test XML documents.

The validator shows that you have two issues:

  1. Some of your attribute values use an invalid quote character: vs. ", and
  2. you need to close the LinearLayout tag with /> instead of just >.

Upvotes: 1

Mike Fahy
Mike Fahy

Reputation: 5707

Looks like you have "smart quotes" ( not simple " double quotes) around some attributes in your LinearLayout element.

Upvotes: 1

Xcalibur37
Xcalibur37

Reputation: 2323

Did you copy and paste that from word? Your quotes look a little funky. Sometimes word will use a different character than the expected " for double quotes. Make sure those are all consistent. Otherwise, the syntax is invalid.

Upvotes: 3

Related Questions