Questions tagged «xml-nil»

7
表示空XML元素的正确方法是什么?
我已经看到null以几种方式表示的元素: 该元素存在xsi:nil="true": <book> <title>Beowulf</title> <author xsi:nil="true"/> </book> 该元素存在,但表示为一个空元素(我认为这是错误的,因为“空”并且null在语义上有所不同): <book> <title>Beowulf</title> <author/> </book> <!-- or: --> <book> <title>Beowulf</title> <author></author> </book> 返回的标记中根本不存在该元素: <book> <title>Beowulf</title> </book> 该元素有一个<null/>子元素(来自下面的TStamper): <book> <title>Beowulf</title> <author><null/></author> </book> 是否存在正确或规范的方式来表示这样的null值?除了上述示例,还有其他方法吗? 上面示例的XML是人为设计的,因此请不要过多阅读。:)
166 xml  null  xml-nil 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.