文档类型定义与XML模式定义 [英] Document Type Defination vs XML Schema Defination

查看:85
本文介绍了文档类型定义与XML模式定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)v可以在dtd中定义日期类型吗?
2)在dtd中,(*)表示0或更大,而(+)表示1或更大,我们如何在dtd中定义上限?

1)Can v define date type in dtd?
2)In dtd (*)means 0 or more and (+)means 1 or more,how we can define upper limit in dtd?

推荐答案

定义的数据类型,请记住,与文档类型相比,XML Schema定义提供了更多的表达能力.与模式定义相比,DOCTYPE可以认为是基本的.另外,XML标准中的DTD并不是该语言的关键字,而是语言定义中使用的术语(非常脏,请谨慎);存在文档类型或DOCTYPE,它仅被解析为XML文档的一部分. DTD还是所谓的外部引用和的常用类型扩展.这种差异看似微妙,但却引起了许多困惑.

要获得所有疑问的答案,请参阅本文档以及本文档中的参考资料: http://www.w3.org/TR/REC-xml/ [ ^ ].特别是,您将看到多重性规范受?","*"和"+"的限制.

—SA
If you need well-defined data types, bear in mind that XML Schema definition provides much more expressive power compared to Document type. Compared to schema definition, DOCTYPE can be considered rudimentary. Also, DTD in XML Standard is not a keyword of the language but a term used in language definition (very dirty, buy the way); there is Document type or DOCTYPE, which is only parsed as a part of XML document. DTD is also just a usual type extension for so called external reference and. The difference seems subtle but it has been a source of many confusions.

To get answers to all you question, see this and the references from this document: http://www.w3.org/TR/REC-xml/[^]. In particular, you will see that multiplicity specification is limited by ''?'', ''*'' and ''+''.

—SA


这篇关于文档类型定义与XML模式定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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