Http://www.w3school.com.cn/xml/xml_namespaces.aspXML Namespace (xmlns) attribute
The XML namespace attribute is placed in the start tag of the element and uses the following syntax:
xmlns:namespace-prefix= "NamespaceURI"
When a namespace is defined in the start tag of an element, all child elements with the same prefix are associated with the same namespace.
Note: The address used to mark the namespace is not used by the parser to find information. Its only function is to give the namespace a unique name. However, many companies often use namespaces as pointers to the actual web pages that contain information about namespaces.
Please visit http://www.w3.org/TR/html4/.
Uniform Resource Identifier (Uniform Resource Identifier (URI))
A Uniform Resource identifier is a string of characters that can identify an Internet resource. The most common URI is the Uniform Resource Locator (URL) used to indicate the address of the Internet domain name. Another less common URI is a Uniform Resource name (URN). In our example, we only use URLs.
Default Namespaces Namespace
Defining a default namespace for an element allows us to omit the work of using prefixes in all child elements.
Please use the following syntax:
Xmlns= "NamespaceURI"
This XML document carries the information in a table:
xmlns="http://www.w3.org/TR/html4/"
> <tr> <td>Apples</td> <td>Bananas</td> </tr></table >
This XML document carries information about a piece of furniture:
xmlns="http://www.w3school.com.cn/furniture"
> <name>african Coffee table</name> <width>80</width> <length>120 </length></table>
The actual application of namespaces
When you start using XSL, you will soon see the namespaces in the actual use. XSL style sheets are used to convert XML documents to other formats, such as HTML.
If you look closely at the following XSL document, you will see that most of the tags are HTML tags. Non-HTML tags have prefix xsl and are labeled by this namespace: "Http://www.w3.org/1999/XSL/Transform":
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
><xsl:template match= "/" >
XML Namespace (xmlns) attribute