【发布时间】:2014-09-30 22:43:32
【问题描述】:
我看到下面的文档使用了 2 个命名空间
**
<root>
<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.w3schools.com/furniture">
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table>
</root>
**
问题:-
命名空间是否有任何命名约定,还是应该只是一个有效的 http 地址?
例如:- 在下面的示例中,我给出了“test1”和“test2”。它有效吗?
<root>
<h:table xmlns:h="http://test1.com">
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
<f:table xmlns:f="http://test2.com">
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table>
</root>
【问题讨论】:
标签: xml namespaces