是否有 xml 命名空间约定?
Is there a xml namespace convention?
很抱歉在堆栈溢出中提出另一个问题。
xml 命名空间有什么限制吗?
我正在使用 python2 rdflib 手动创建一个 xml 文件。
事实证明 http://domain.xxx/subdirectory/ and http://domain.xxx/subdirectory/xxx# 可能是 xml 中的命名空间。
但是,http://domain.xxx/subdirectory/xxx_ 无效。
它自动转换为命名空间:http://domain.xxx/subdirectory/
rdflib 是否对处理命名空间有限制或像 http://domain.xxx/subdirectory/xxx_ 这样的命名空间无效。
谢谢!
原XML document definition from 1999 状态
The attribute's value, a URI reference, is the namespace name identifying the namespace. The namespace name, to serve its intended purpose, should have the characteristics of uniqueness and persistence. It is not a goal that it be directly usable for retrieval of a schema (if any exists).
命名空间(不是前缀)是一个唯一的字符串就足够了,但在这种情况下,您通常会收到类似
的警告
namespace warning : xmlns: URI ... is not absolute
按照惯例,它应该是
- URI (XML 1.0, RFC3986) according to the specification for XML-1.0 namespaces.
- IRI (XML 1.1, RFC3987) according to the specification for XML-1.1 namespaces.
很抱歉在堆栈溢出中提出另一个问题。
xml 命名空间有什么限制吗?
我正在使用 python2 rdflib 手动创建一个 xml 文件。
事实证明 http://domain.xxx/subdirectory/ and http://domain.xxx/subdirectory/xxx# 可能是 xml 中的命名空间。
但是,http://domain.xxx/subdirectory/xxx_ 无效。
它自动转换为命名空间:http://domain.xxx/subdirectory/
rdflib 是否对处理命名空间有限制或像 http://domain.xxx/subdirectory/xxx_ 这样的命名空间无效。 谢谢!
原XML document definition from 1999 状态
The attribute's value, a URI reference, is the namespace name identifying the namespace. The namespace name, to serve its intended purpose, should have the characteristics of uniqueness and persistence. It is not a goal that it be directly usable for retrieval of a schema (if any exists).
命名空间(不是前缀)是一个唯一的字符串就足够了,但在这种情况下,您通常会收到类似
的警告namespace warning : xmlns: URI ... is not absolute
按照惯例,它应该是
- URI (XML 1.0, RFC3986) according to the specification for XML-1.0 namespaces.
- IRI (XML 1.1, RFC3987) according to the specification for XML-1.1 namespaces.