Friends who have just learned XML will often be confused by name space, I will do a simple explanation.
The general way to write XML nodes is the
There are countless XML documents in the world, and there are countless nodes, attributes, their names are likely to be the same. The name space is to distinguish the same name, and the nodes, attributes of the meaning are different.
For example, there is a node called "car" in document A and Document B, but the meaning of "car" in document A and Document B is completely different (for example, one is a train), if there is no name space, The nodes in these two documents have no way to distinguish.
First look at a namespace example:
The name space is defined using the XMLNS keyword. In this example, XMLns = "http://www.hz-sp.com/2005/xmlschema-Menu" defines the default namespace, so Menu_Items is "http://www.hz-sp.com/2005 / Xmlschema-menu "This name is space. Similarly, Menu_Item is the child's node of Menu_Items, without a namespace prefix, so it also belongs to this name space. Menu_items child node, attribute, if not add a namespace prefix, belongs to this default name space. That is, the nodes in
XMLns: XSI = "http://www.w3.org/2001/xmlschema-instance" This sentence defines the namespace prefix XSI, and there is xsi: schemAlocation = ... This is said, that is, the attribute SCHEMALOCATION is It belongs to the namespace "http://www.w3.org/2001/xmlschema-instance".
In addition, although these namespaces are URL situations, if you point this URL, it is likely that this is a URL that does not exist. W3C recommends using the URL to name the name space, to ensure the uniqueness of the name space name. You can use the names such as "MyName007" to name your own namespace, but this approach is not recommended, because such names cannot guarantee uniqueness.