什么是targetNamespace功能?
<schema xmlns="http://www.w3.org/2001/SchemaXML"
targetNamespace="http://www.example.com/name"
xmlns:target="http://www.example.com/name">
Run Code Online (Sandbox Code Playgroud)
据我所知,它xmlns="http://www.w3.org/2001/SchemaXML定义了Schema XML命名空间.
我也理解,xmlns:target="http://www.example.com/name"如果我使用前缀"target"创建自己的模式,则为我自己的词汇表定义名称空间.它充当URI的代理或占位符http://www.example.com/name.
这似乎足以定义命名空间参与者所需的边界和词汇表.那么为什么我需要一个targetNamespace复制http://www.example.com/name命名空间的属性呢?
更好的是,有人可以逐点解释这个程序吗?
package com.paad.todolist;
import java.util.ArrayList;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnKeyListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
public class ToDoList extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Inflate your view
setContentView(R.layout.main);
// Get references to UI widgets
ListView myListView = (ListView)findViewById(R.id.myListView);
final EditText myEditText = (EditText)findViewById(R.id.myEditText);
// Create the array list of to do items
final ArrayList<String> todoItems = new ArrayList<String>();
// Create the …Run Code Online (Sandbox Code Playgroud)