Reputation: 85
When developing android, we usually use xml when developing a layout file.
example)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
...
I have a query at that point. How to access http://schemas.android.com/apk/res/android ?
As I found some information. I know that is not a URL, it is URI. So can not access through the internet. Then where is namespace information? How can access that information?
Upvotes: 5
Views: 4728
Reputation: 3187
The following URI is a namespace name, according to Namespaces in XML 1.0 (Third Edition).
http://schemas.android.com/apk/res/android
In section 3 Declaring Namespaces, it is stated that:
The namespace name, to serve its intended purpose, SHOULD have the characteristics of uniqueness and persistence. It is not a goal that it be directly usable for retrieval of a schema (if any exists).
Some XMLs have no schema. In such XMLs, you can't have it.
The goal of namespace names is to avoid collisions in element names and attribute names. XMLs use URIs as namespace names for their uniqueness and persistence.
Upvotes: 6