Click here to Skip to main content
14,828,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i get this error

- Error parsing XML: junk after document element
-there are multple junk root elements , line 12
i changed the < - - to -- because it doesnt show in preview

(here is my line 12 )
--TextView
android:text="Create Account"
android:layout_width="match_parent"
android:layout_weight="20"
android:layout_height="0dp"
android:textColor="#368deb"
android:id="@+id/txtCreateAccount"
android:gravity="center"
android:textstyle="bold"
android:textSize="25sp" />

and heres my full code

--LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/background_light"
android:weightSum="100"
android:minWidth="25px"
android:minHeight="25px"/>


--TextView
android:text="Create Account"
android:layout_width="match_parent"
android:layout_weight="20"
android:layout_height="0dp"
android:textColor="#368deb"
android:id="@+id/txtCreateAccount"
android:gravity="center"
android:textstyle="bold"
android:textSize="25sp" />


--Button
android:text="Sign in"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="15"
android:id="@+id/btnsignin"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:textsize="15sp" />


--TextView
android:text="Or"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="15"
android:id="@+id/txtOr"
android:textColor="#000"
android:gravity="center" />

--Button
android:text="Sign up with Email"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="15"
android:id="@+id/btnsignup"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:textsize="15sp" />

--RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="35"
android:minWidth="25px"
android:minHeight="25px"/>

--ProgressBar
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progressBar1"
android:indeterminate="true" />

--/RelativeLayout>

--/LinearLayout>

thanks in advance
Posted
Updated 23-Feb-18 4:31am
Comments
Kornfeld Eliyahu Peter 24-Nov-15 6:35am
   
1. It's not looks like XML
2. In any case XML can have only one! root element (document root)
jamesmc1535 24-Nov-15 6:39am
   
im not sure i understand what youre explaining to me XD .
phil.o 24-Nov-15 8:46am
   
So why not following a brief tutorial on XML? :) This is pretty basic stuff that you should understand prior to using XML.

You have to work on your code formatting, currently it is hard to see the XML in your post...But even so...
An XML document can have one, and only one, root element

XML
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- everything goes here -->
</root>

XML
<?xml version="1.0" encoding="utf-8"?>
<root>
</root>
<root2>
  <!-- this is a second root-level element, which is wrong and will threw an error -->
</root2>


I I try to imagine your post as XML I see multiply root elements, and that is forbidden...
   
v3
Comments
jamesmc1535 24-Nov-15 7:02am
   
i will change it quickly , this is from a tutorial i was following to get used to the xamarin layout ect ect
jamesmc1535 24-Nov-15 7:09am
   
i changed it to on all the roots? but i got an error now saying , "not well informed"
Kornfeld Eliyahu Peter 24-Nov-15 7:13am
   
Maybe 'not well formed'?
There are several rules of how XML should be formatted, including special chars...
Try to load your content here and examine it to see where/what is the problem...
http://codebeautify.org/xmlviewer
jamesmc1535 25-Nov-15 2:30am
   
https://www.youtube.com/watch?v=tf2O_t-ayJ8 < this is the tutorial i was following and i did everything the same..
Kornfeld Eliyahu Peter 25-Nov-15 3:03am
   
In that tutorial here is a LinerLayout element as root element of all the controls...In your post there is not!
jamesmc1535 25-Nov-15 9:56am
   
thanks for all the help really appreciate it , got it sorted out ,i had the liniar on top as well it just didnt add it to the message , i closed the program and started over, my error was lack of xml knowledge, XD , like for instance i did not add
As a compliment to Solution 1, I think it is a good idea to get some basic XML knowledge.
One place to start is here: W3Schools: XML Tutorial[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900