如何访问http://schemas.android.com/apk/res/android?
how to access http://schemas.android.com/apk/res/android?
在开发android的时候,我们通常在开发布局文件的时候使用xml
示例)
<?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">
...
那时我有一个疑问。
如何访问 http://schemas.android.com/apk/res/android ?
因为我找到了一些资料。
我知道那不是 URL,它是 URI。所以无法通过互联网访问。那么命名空间信息在哪里呢?如何访问该信息?
根据 Namespaces in XML 1.0 (Third Edition).
,以下 URI 是一个 命名空间名称
http://schemas.android.com/apk/res/android
在第 3 Declaring Namespaces 部分中指出:
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).
有些 XML 没有架构。在这样的 XML 中,你不能拥有它。
命名空间名称的目的是避免元素名称和属性名称发生冲突。 XML 使用 URI 作为命名空间名称以确保其唯一性和持久性。
在开发android的时候,我们通常在开发布局文件的时候使用xml
示例)
<?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">
...
那时我有一个疑问。 如何访问 http://schemas.android.com/apk/res/android ?
因为我找到了一些资料。 我知道那不是 URL,它是 URI。所以无法通过互联网访问。那么命名空间信息在哪里呢?如何访问该信息?
根据 Namespaces in XML 1.0 (Third Edition).
,以下 URI 是一个 命名空间名称http://schemas.android.com/apk/res/android
在第 3 Declaring Namespaces 部分中指出:
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).
有些 XML 没有架构。在这样的 XML 中,你不能拥有它。
命名空间名称的目的是避免元素名称和属性名称发生冲突。 XML 使用 URI 作为命名空间名称以确保其唯一性和持久性。