是否已弃用DTD? [英] Is DTD deprecated?

查看:103
本文介绍了是否已弃用DTD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

XML模式和DTD之间有什么区别?,两个回答者指出DTD已弃用。其中之一,用户vtd-xml-author,指出

In What is difference between XML Schema and DTD?, two answerers state that DTD "is deprecated". One of them, user vtd-xml-author, states that


DTD已被弃用,因为它的用处受到限制[.. 。]

DTD is pretty much deprecated because it is limited in its usefulness [...]

用户Jesse Chisholm对此发表评论

at which user Jesse Chisholm comments


已弃用?否。[XDR已弃用]过时了吗?也许[...]

Deprecated? No. [XDR is deprecated] Going out of fashion? Maybe [...]

什么是DTD?,用户AlexR对答案的评论如下:

In What is DTD exactly?, user AlexR comments on an answer as follows:


请注意,DTD不赞成使用更具声明性和功能更强大的XSD。

Note that DTD is deprecated in favor of the more declarative and powerful XSD.

在这种情况下,没有人会不同意。

In this case, no-one shows up to disagree.

那么DTD是否已弃用?这肯定是事实,而不是意见。大概是W3C或其他一些标准机构有权确定DTD是否实际上已被弃用。当然,不建议在给定的上下文(例如,特定的软件系统)中使用DTD,而不必在该(或任何)上下文之外弃用DTD。

So is DTD deprecated, or not? It is surely a matter of fact, not of opinion. Presumably it is the W3C or some other standards body who would have the authority to determine whether DTD is in fact deprecated. Of course, the use of DTD in a given context (for example, a particular software system) might be deprecated without DTD itself being deprecated outside of that (or any) context.

推荐答案

DTD尚未正式弃用,,但是指定XML词汇表和语法的方法比现在使用DTD更好。

DTD is not officially deprecated, but there are better choices for specifying an XML vocabulary and grammar than DTD now.

通俗地说,已弃用通常用于指不再受鼓励的旧方法。在这种意义上,可以说不赞成使用DTD。 XSD比DTD更具表现力。 (RELAX NG和Schematron也是更好的选择。)此外,XSD的采用早已超过DTD来指定跨多个部门的XML词汇和语法。

Colloquially, deprecated is often used to refer to an old way that's no longer encouraged. In such a sense, one might say that DTD is deprecated. XSD is much more expressive than DTD. (RELAX NG and Schematron would be better choices as well.) Furthermore, XSD adoption has long surpassed DTD for specifying XML vocabularies and grammars across many sectors.

从技术上讲,已弃用通常适用于负责标准API的当事方官方行为 ,库或其他受其控制的工件。 W3C从未宣布过要弃用DTD,因此从技术上说DTD已过时是不正确的。

Technically, however, deprecated is typically applied to an official act by a party responsible for a standard, API, library, or other artifact under its control. W3C has never declared DTD to be deprecated, therefore it is not technically correct to say that DTD is deprecated.

除了语义,请选择XSD(或RELAX NG或Schematron)作为您开始的所有新XML词汇和语法工作。此时,不必正式弃用DTD并不是一个明智的选择。

Semantics aside, choose XSD (or RELAX NG or Schematron) for any new XML vocabulary and grammar work you begin. DTD doesn't have to be officially deprecated to be a poor choice at this point in time.

这篇关于是否已弃用DTD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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