윤시완
윤시완

Reputation: 11

The meaning of sentence in head of XML

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

When I made android application, I see sentence in head of XML File. But I don't know the meaning of it.

Upvotes: 1

Views: 228

Answers (3)

i.n.e.f
i.n.e.f

Reputation: 1803

In xml Header this is ?xml version="1.0" the xml VERSION you are defining. This is the ENCODING TYPE of xml to be defined encoding="utf-8"? . And this is the NAMESPACE of xml xmlns:android="http://schemas.android.com/apk/res/android" hope this help.

Upvotes: 0

Raghunandan
Raghunandan

Reputation: 133560

I assume you are talking about

<?xml version="1.0" encoding="UTF-8"?>

http://www.w3schools.com/xml/xml_tree.asp

Quoting from the link above

The first line is the XML declaration. It defines the XML version (1.0).

Also check

http://en.wikipedia.org/wiki/UTF-8

<LinearLayout xmlns:android="schemas.android.com/apk/res/android"; 

Its a LinearLayout that you have in xml

xmlns- its xml name space

A quick search on the same topic on stackoverflow gives the below links which should anser your question

Why this line xmlns:android="http://schemas.android.com/apk/res/android" must be the first in the layout xml file?

What does "xmlns" in XML mean?

Upvotes: 1

user3317558
user3317558

Reputation: 482

I think you are talking about this line <?xml version="1.0" encoding="utf-8"?>

That line actually defines the version of .xml file.

Please refer to XML Standards

Upvotes: 0

Related Questions