网站制作

本类阅读TOP10

·IIS 安装配置全攻略
·用VS.NET打开网上下载的.NET web项目出错的解决办法
·HTML 4.0 语言快速参考
·限制TextArea区的文字输入数量
·如何在网页上实现进度条
·Apache的配置步骤及测试
·谈谈Jesse James Garrett提到的Ajax
·html基础学习笔记(2)
·页面垂直居中的两种方法
·用asp遍历目录下文件的例子

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
从 DTDs 转换到 XML Schemas 时元素和属性的变化

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

从 DTDs 转换到 XML Schemas 时元素和属性的变化

DTD XML Schema
<!ELEMENT ROOT (A,B) >
<element name="ROOT">
 <complexType content="elementOnly">
  <element ref="t:A">
  <element ref="t:B">
 </complexType>
<element>
<!ELEMENT ROOT (A|B) >
<element name="ROOT">
 <complexType content="elementOnly">
  <choice>
   <element ref="t:A">
   <element ref="t:B">
  </choice>
 </complexType>
<element>
<!ELEMENT ROOT (A|(B,C)) >
<element name="ROOT">
 <complexType content="elementOnly">
  <choice>
   <element ref="t:A">
   <sequence>
    <element ref="t:B">
    <element ref="t:C">
   </sequence>
  </choice>
 </complexType>
<element>
<!ELEMENT ROOT (A?,B+,C*) >
<element name="ROOT">
 <complexType content="elementOnly">
  <element ref="t:A" minOccurs="0">
  <element ref="t:B" maxOccurs="unbounded">
  <element ref="t:C" minOccurs="0" maxOccurs="unbounded">
 </complexType>
<element>

DTD XML Schema
<!ATTLIST ROOT
    a CDATA #REQUIRED>
<element name="ROOT">
 <complexType content="elementOnly">
  <attribute name="a" type="string" use="required"/>
 </complexType>
<element>
<!ATTLIST ROOT
    a CDATA #IMPLIED>
<element name="ROOT">
 <complexType content="elementOnly">
  <attribute name="a" type="string" use="optional"/>
 </complexType>
<element>
<!ATTLIST ROOT
    a (x|y|z) #REQUIRED;>
<element name="ROOT">
 <complexType content="elementOnly">
  <attribute name="a">
   <simpleType base="string">
    <enumeration value="x"/>
    <enumeration value="y"/>
    <enumeration value="z"/>
   </simpleType>
  </attribute>
 </complexType>
<element>
<!ATTLIST ROOT
    a CDATA #FIXED "x">
<element name="ROOT">
 <complexType content="elementOnly">
  <attribute name="a" type="string" use="fixed" value="x"/>
 </complexType>
<element>




相关文章

相关软件