【问题标题】:Difference between having targetnamespace attribute value as dot vs slashes in .xsd file?在 .xsd 文件中将 targetnamespace 属性值作为点与斜线之间的区别?
【发布时间】:2013-09-19 11:54:18
【问题描述】:

有人能告诉我定义 targetnamespace 和 spring-ws 的区别吗

http://checkingaccountservice.example.zoo 

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="http://checkingaccountservice.example.zoo"
        elementFormDefault="qualified">
    ...
<xsd:schema>

vs

http://zoo/example/checkingaccountservice/

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="http://zoo/example/checkingaccountservice"
        elementFormDefault="qualified">
    ...
<xsd:schema>

提前致谢:)

【问题讨论】:

    标签: xml spring xsd


    【解决方案1】:

    说白了,没有区别。

    XML 命名空间 URI 将被视为不透明字符串。它只是一个防止冲突的唯一字符串。无论您使用“。”或者 '/' 字符串中的字符是一个选择,只要你能保证字符串是唯一的。

    希望这会有所帮助,

    【讨论】:

    • 我要补充一点,虽然不是绝对必要,但建议确保命名空间名称是合法的绝对 URI。如果不是,某些软件会拒绝它们,尽管大多数软件会按书面形式接受它们。使用域名部分是您拥有或控制的域的 URI 也是一种很好的方式。
    猜你喜欢
    • 1970-01-01
    • 2014-08-09
    • 1970-01-01
    • 2016-11-20
    • 2015-04-26
    • 2019-06-13
    • 1970-01-01
    • 2016-09-17
    相关资源
    最近更新 更多