xsi: 前缀是否假定在 XML 中是已知的? [英] is the xsi: prefix assumed to be known in XML?

查看:14
本文介绍了xsi: 前缀是否假定在 XML 中是已知的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 XML 解析器时,我看到很多 XML 文件使用 xsi:schemaLocation 属性而没有声明 xsi 命名空间.

Working on an XML parser, I see a lot of XML files using the xsi:schemaLocation attribute without declaring the xsi namespace.

这是一个错误,还是有规范说明它在解析之前被假定为已知?为xsi"查询命名空间规范没有结果,但可能答案在另一个文档中.

Is it an error or is there a spec stating it is assumed to be known before parsing? Grepping the namespaces spec for "xsi" gives no results, but maybe the answer is in another document.

推荐答案

没有任何命名空间 [XML 命名空间除外] 可以假定为已知.

No namespaces [other than the XML namespace] can be assumed to be known.

如果文档包含 xsi 前缀,则还应该有一个关联的命名空间(通常是 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance").

If a document contains an xsi prefix, there should also be an associated namespace (which would normally be xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance").

如果未声明命名空间,则 XML 文件无效.

If the namespace is not declared, the XML file is not valid.

这篇关于xsi: 前缀是否假定在 XML 中是已知的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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