带有 HTTPS 的 XML 命名空间 URI? [英] XML Namespace URI with HTTPS?

查看:65
本文介绍了带有 HTTPS 的 XML 命名空间 URI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

xmlns URI 与 https 协议是否更好?

Is it better to have a xmlns URI with https protocol?

例如这是手册推荐的方式:

For example this is the recommended way by the manual:

<http xmlns="http://www.springframework.org/schema/security"/>

使用这种方式是否合法且更好?

Is it legal and better to use this way?

<http xmlns="https://www.springframework.org/schema/security"/>

  1. 是否有 XML 解析器尝试连接到由 xmlns URI 定义的地址?
  2. 解析器总是通过 xsi:schemaLocation 属性下载模式?
  1. Are there XML parsers that try to connect to an address defined by xmlns URI?
  2. Parsers always download schemas by xsi:schemaLocation attribute?

推荐答案

URI 是命名空间名称,它标识命名空间.

The URI is the namespace name, which identifies the namespace.

虽然,在某些 URI 方案(如 httphttpsftp 等)的情况下,可以提供架构(或其他相关信息),这是 不是目标":

While, in case of some URI schemes (like http, https, ftp etc.), it would be possible to provide the schema (or other related information), this is "not a goal":

目标不是直接用于检索模式(如果存在).

It is not a goal that it be directly usable for retrieval of a schema (if any exists).

(大多数 URI 方案不允许以例如 urntagjabber 等开头)

(Most URI schemes wouldn’t allow this to begin with, e.g., urn, tag, jabber etc.)

您应该完全按照文档指定 URI,因为这是消费者期望和寻找的(大多数消费者可能从未尝试实际检索 URI),并且 XML 名称 1.0 对 比较 URI.

You should specify the URI exactly as documented, as this is what consumers expect and look for (most consumers probably never try to actually retrieve the URI), and XML Names 1.0 is pretty strict about comparing URIs.

所有这些都是不同的命名空间名称,即使它们会解析为同一个 Web 文档:

All these would be different namespace names, even if they would resolve to the same Web document:

http://www.springframework.org/schema/security
http://www.Springframework.org/schema/security
httP://www.springframework.org/schema/security
http://www.springframework.org/schema/Security
https://www.springframework.org/schema/security
https://www.springframework.ORG/schema/security

这篇关于带有 HTTPS 的 XML 命名空间 URI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆