Title: DTD vs' XML Schema
1DTD vs. XML Schema
- What is a DTD?
- Stands for Document Type Definition
- A DTD instance is a schema that describes the
vocabulary and structures of XML files that
conform to it - Part of XML V1.0 Spec.
2Why Are Schemas Valuable?
- Provide standard structures for data exchange
- Provide constraints for testing document validity
3Why Are Schemas Valuable?
- Help manage integration of documents and data
- Framework for both document and data structures
- Help separate parts of documents for intelligent
search/manipulation
4What DTDs Dont Do Well
- Allow for the detailed specification of data
types for data content - Verify that data conforms to data type rules
5What is XML Schema?
- Proposed new XML schema specification mechanism
from the W3C - Form is XML based
6Why Use XML Schema?
- To specify data types for data content
- To verify that an XML documents data content
conforms to its defined data types
7DTD vs. XML Schema Ex. 1
DTD lt!ELEMENT MeasurementDetails (primaryIndex,
startIndex, endIndex, (evenSampling
unevenSampling), indexUnits, uomNamingSystem,
comment?)gt
XML Schema ltelementType name
"MeasurementDetails"gt ltsequencegt
ltelementTypeRef name "primaryIndex"/gt
ltelementTypeRef name "startIndex"/gt
ltelementTypeRef name "endIndex"/gt
ltchoicegt ltelementTypeRef name
"evenSampling"/gt
ltelementTypeRef name "unevenSampling"/gt
lt/choicegt ltelementTypeRef name
"indexUnits"/gt ltelementTypeRef name
"uomNamingSystem"/gt ltelementTypeRef name
"comment" minOccur "0" maxOccur "1"/gt
lt/sequencegt lt/elementTypegt
8DTD vs. XML Schema Ex. 2
DTD lt!ELEMENT wellName (PCDATA)gt lt!ATTLIST
wellName type (API10 API12 API14
CPA WWN IRIS21 NPD DTI
LOCALFIELD SHORTNAME
PROJECTNAME UNKNOWN OTHER)
REQUIREDgt
XML Schema ltelementType name "wellName"gt
ltdatatypeRef name "string"/gt ltattrDecl name
"type" required "true"gt ltdatatypeRef
name "ENUMERATION"gt ltenumerationgt
ltliteralgtAPI10lt/literalgt
ltliteralgtAPI12lt/literalgt
ltliteralgtAPI14lt/literalgt
ltliteralgtCPAlt/literalgt ...
lt/enumerationgt lt/datatypeRefgt
lt/attrDeclgt lt/elementTypegt
9Why Continue to Use DTDs?
- XML Schema is only in draft form today
10How Can We Promote Standard Schemas?
- Register schemas with XML standards organizations
- XML.ORG (http//www.xml.org)
- Accepts DTD definitions
- BizTalk (http//www.biztalk.org)
- Accepts XML Schema definitions
- POSC plans to register WellLogML with both
organizations
11Where Can I Get More Information?
- http//www.posc.org/ebiz
- Check out the XML Resources and Organizations
links - Glance through the Glossary for a more complete
list of XML terms