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

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>

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念