document.getElementsByTagName("table")
不知道应该返回哪个元素,因此引入了namespace- namespace全局唯一,统一资源标识符(Uniform_Resource_Identifier,URI)。URI不一定可访问
<h:table xmlns:h="http://www.w3.org/TR/html4/">
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
<f:table xmlns:f="http://www.w3school.com.cn/furniture">
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table>
<table xmlns="http://www.w3.org/TR/html5/">
<tr>
<td>Apples</td>
<td>Bananas</td>
</tr>
</table>
- XSD(Xml_Schemas_Definition)(Schema文件),用来定义xml文档结构及格式检查器
- 下面xsd文件中,创建了myTag标签,有id、name、age三个属性
targetNamespace
该xsd对应的namespace
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.listao.site/schema/myTag"
elementFormDefault="qualified"
>
<element name="myTag">
<complexType>
<attribute name="id" type="string"/>
<attribute name="name" type="string"/>
<attribute name="age" type="integer"/>
</complexType>
</element>
</schema>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:listao="http://www.listao.site/schema/myTag"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.listao.site/schema/myTag http://www.listao.site/schema/myTag.xsd
">
<listao:myTag id="msb" name="ooxx" age="18"/>
</beans>