加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

DTD及Schema的使用中一些小的问题及解决方案

发布时间:2020-12-16 05:32:20 所属栏目:百科 来源:网络整理
导读:DTD 元素出现个数: ?: 0-1 * : 0-n + :1-n Schema: 无序Children的实现,可以用all或者choice 区别: all每个元素只能出现最少0次,最多1次 choice每个元素最多可以出现n次,最少0次 简单元素的attribute属性 例如:text name="hello" type="string"HelloWo

DTD

元素出现个数:

?: 0-1

* : 0-n

+ :1-n

Schema:

无序Children的实现,可以用all或者choice

区别:

all每个元素只能出现最少0次,最多1次

choice每个元素最多可以出现n次,最少0次

简单元素的attribute属性

例如:<text name="hello" type="string">HelloWorld</text>

Schema的实现是:

<element name="text" minOccurs="0">
	<complexType>
		<simpleContent>
			<extension base="string">
				<attribute name="name" type="string" />
				<attribute name="type" type="string" />
			</extension>
		</simpleContent>
	</complexType>
</element>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读