Fri*_*izz 4 xml xsd xml-namespaces
我经常在XML模式文件中看到类似下面的代码.据我所知,xmlns是定义一个新的命名空间.但是,跟随xmlns的长URL是否真的有必要?我的意思是程序,解析器,还是真正调用的,例如"http://www.springframework.org/schema/beans"?或者这条线就像这样:
<beans xmlns="beansNamespace">
Run Code Online (Sandbox Code Playgroud)
这是其中之一
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
"
>
Run Code Online (Sandbox Code Playgroud)
不,当它看到时,解析器不会转到http://无论如何
<element xmlns='http://whatever...'>
IETF建议XML名称空间是URI,但该URI不必是HTTP URI,实际上它不需要附加任何"网络协议".它们仅用于识别.
在某些情况下,人们将名称空间URI设计为HTTP URI,并在该URI处插入名称空间的人类可读文档.因此,如果一个人要访问该地方,他们将了解该命名空间的模式.但该公约并未得到广泛采用.
另请参阅XML中的"xmlns"是什么意思?
和,是什么原因导致Web服务URL和命名空间之间的区别吗?
| 归档时间: |
|
| 查看次数: |
360 次 |
| 最近记录: |