Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to parse QName

Tags:

xml

When I do a syntax check on the following XML code I get the error:

error on line 2 at column 14: Failed to parse QName 'xmlns:'

Can anyone tell me what I'm doing wrong? Thanks!

<?xml version = "1.0" encoding = "utf-8"?>
<Bitmap xmlns: android = "http://schemas.android.com/apk/res/android"
android: src = "@ assets/dragon.png" />
like image 547
user3826248 Avatar asked Jul 10 '14 16:07

user3826248


1 Answers

Infact you could have tried this yourself

XML does not allow white-space characters in element- or attribute-names.

Remove the space between xmlns: and android ; Also android: and src

<?xml version = "1.0" encoding = "utf-8"?>
<Bitmap xmlns:android = "http://schemas.android.com/apk/res/android"
android:src = "@ assets/dragon.png" />

I tried using online validator, and dont see errors now http://www.w3schools.com/xml/xml_validator.asp

Update: As @Ian Roberts suggested, Please use this validator. I tried this, it was showing all possible warnings as well - http://validator.w3.org/

like image 62
spiderman Avatar answered Nov 07 '22 02:11

spiderman