为什么 URL 在 XML 命名空间中? [英] Why are URLs in XML namespaces?

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

问题描述

以这一行为例:

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
</configuration>

一些简短的研究告诉我,没有必要在该 URL 上托管任何内容.因此,如果它只是对包含在本地程序集中的命名空间的引用,为什么要使用 URL 而不是像 .NET 通常使用的常规命名空间(例如 System.Data)?

Some brief research has taught me that nothing necessarily has to be hosted at that URL. Therefore, if it's just a reference to a namespace contained in a local assembly, why use URLs instead of regular namespaces like the ones typically used by .NET (System.Data, for example)?

推荐答案

这只是一个约定.URI(即它们的本质,而不是真正的 URL)是一种方便且全球通用的识别资源的方式.另一方面,.NET 样式的标识符对于 .NET 开发人员来说是熟悉和可识别的 - XML 比 .NET 更重要.

It's just a convention. URIs (which is what they are, not really URLs) are a convenient and globally-familiar way of identifying resources. On the other hand, .NET-style identifiers are familiar and recognisable to, well, .NET developers - there's rather more to XML than .NET.

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

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