利用者:CmplstofB/下書き/XSD
< 利用者:CmplstofB | 下書き
DTD | XSD |
---|---|
<!ENTITY % inline "(#PCDATA | b | i | u)*">
<!ELEMENT p %inline;>
<!ELEMENT b %inline;>
<!ELEMENT i %inline;>
<!ELEMENT u %inline;>
|
<xsd:complexType name="inline" mixed="true">
<xsd:choice maxOccurs="unbounded">
<xsd:element ref="b"/>
<xsd:element ref="i"/>
<xsd:element ref="u"/>
</xsd:choice>
</xsd:complexType>
<xsd:element name="p" type="inline"/>
<xsd:element name="b" type="inline"/>
<xsd:element name="i" type="inline"/>
<xsd:element name="u" type="inline"/>
|
DTD | XSD |
---|---|
<!ELEMENT html (head, body)>
|
<xsd:element name="html">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="head"/>
<xsd:element ref="body"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
|
出典: Fiorello, Davide・Gessa, Nicola・Marinelli, Paolo・Vitali, Fabio (2004) “DTD++ 2.0: Adding support for co-constraints.”
DTD | XSD |
---|---|
<!ENTITY % AOrB "a | b">
<!ELEMENT x ((%AOrB;) , c)>
|
<xsd:group name="AOrBGroup">
<xsd:choice>
<xsd:element ref="a"/>
<xsd:element ref="b"/>
</xsd:choice>
</xsd:group>
<xsd:element name="x">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="AOrBGroup"/>
<xsd:element ref="c"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
|
出典: Priscilla Walmsley (2001) “Definitive XML Schema” Pearson Education.