Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 XMLWriter 创建我的 MySQL 数据库的 XML 输出,我想知道如何<hello></hello>通过这样做来防止这种情况发生<hello>nil</hello>
<hello></hello>
<hello>nil</hello>
所以基本上用“nil”替换“”。
<hello></hello>适用于在 XML 中指示空节点;另一种方式是<hello />。替换为nil意味着它不再是一个空节点;它是一个带有文本内容的节点nil。
<hello />
nil
如果您进行替换,您将更改 XML 中数据的含义。这是一个可怕的想法。