i:nil="true" 是什么意思? 意思是?
我有一个 xml,其中有带有 i:nil="true" 的节点。 这意味着什么?
例如:
<FirstName i:nil="true" />
这是否意味着不同的东西:
<FirstName />
如果是,有什么区别?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这意味着 FirstName 为 null
这意味着 FirstName = ""
对 FirstName 所做的假设是字符串类型。
This means FirstName is null
This means FirstName = ""
Assumption made on FirstName is of string type.
也许
i:nil
实际上意味着xsi:nil
,这意味着FirstName
元素为空,即没有任何强> 内容——甚至不是""
。 它指的是 XML 模式中的nillable
属性。Maybe
i:nil
actually meansxsi:nil
, this means that theFirstName
element is empty, i.e. does not have any content -- not even""
. It refers to thenillable
property in XML Schema.nil 是一个属性,在
i
命名空间中定义。 对于此 FirstName 节点,该属性的值为true
。它与此类似,只是名称和值不同:
这里,
form
是节点的名称,类似于代码中的FirstName
和name 是一个值为“test”的属性,类似于值为“true”的属性
nil
。这意味着什么取决于读取 xml 文档的应用程序。
如果我大胆猜测,我会说这看起来像是定义某种模式的 xml 文档的一部分,并且 FirstName 字段可以有 NULL 或 nil 值,即空,或未知。
nil is an attribute, defined in the
i
namespace. For this FirstName node, the attribute has the valuetrue
.It's similar to this, just with different names and values:
Here,
form
is the name of the node, similar toFirstName
from your code, andname
is an attribute with a value of "test", similar to your attributenil
with a value of "true".What this means depends on the application reading the xml document.
If I were to venture a guess, I'd say that this looks like part of a xml document defining some kind of schema, and that the FirstName field can have a NULL or
nil
value, meaning empty, or unknown.