首页 > 解决方案 > 有没有办法表明一个节点在 XML 文件中已被弃用?

问题描述

我们正在尝试将我们生成并由外部消费者使用的 XML 提要形式化。在 XML 文件中或在其 DTD 中是否有语法来指示特定节点已被弃用并将在未来被删除?

标签: xmldtd

解决方案


(1) 您可以为此使用 XML 注释<!-- Document here whatever needed -->

(2) 最好使用 XSD 而不是 DTD。XSD 也有文档专用标签。请看下文。

<xsd:annotation>
    <xsd:documentation>Document here whatever needed</xsd:documentation>
</xsd:annotation>

推荐阅读