DTD는 namespace를 지원하지 않고
XSD는 XML 표준에 namespace를 지원한다.
XSD를 쓰는게 더 나을거 같기도 하고..
[링크 :
http://stackoverflow.com/questions/1490583/dtd-or-xml-schema-which-one-is-better]
일단 예제를 보면 DTD는 XML 포맷이 아니고 XSD는 XML 포맷이다.
<!DOCTYPE note
[
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
[링크 : http://www.w3schools.com/xml/xml_dtd.asp] DTD |
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
[링크 : http://www.w3schools.com/schema/] XSD |
[링크 :
http://bsp.mits.ch/xsd2dtd/] XSD to DTD