ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing

ExpertRating Home
ExpertRating Benefits
Recommend ExpertRating
Suggest More Tests
Privacy Policy
XML Tutorial - Index
XML Tutorial - Introduction to XML
XML Tutorial - How XML interact with data?
XML Tutorial - How to write first XML document
XML Tutorial - What are XML Elements and Attributes?
XML Tutorial - What is XML Schema and DTD?
XML Tutorial - Which Browser support XML?
XML Tutorial - XML and Styles
XML Tutorial - Embedding XML in HTML
XML Tutorial - Working with XML Parser
XML Tutorial - Working with CDATA

Online Personal Trainer Certification
Personal Trainer Certification (Spanish)
Six Sigma Certification
Find a Personal Trainer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Master Black Belt Certification
Six Sigma Green Belt Certification
Life Coach Certification
Lean Management Certification
Lean Six Sigma Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
Business Analyst Certification
SEO Certification
Online Business Writing Course & Certification
Makeup Artist Certification
Baby Sitting Course & Certification
Time Management Certification
Health Club Management Certification
Medical Coding Certification
Medical Billing Certification
Business Analysis Course
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
Event Management Certification
Test Search by Job Title
Administrative Assistant Certification
Virtual Assistant Certification
  All Online Courses


  Home > Courses, Tutorials & eBooks > XML Tutorial > What are XML Schema and a DTD?

XML Tutorial - What are XML Schema and a DTD?

Page 2 of 2

How is the document validated?

The DTD describes a model of the structure of the content of an XML document. This model says what elements must be present, which ones are optional, what their attributes are, and how they can be structured with relation to each other. While HTML has only one DTD, XML allows you to create your own DTDs for your applications. This gives you complete control over the process of checking the content and structure of the XML documents created for that application. This checking process is called validation.

A valid XML document is not just syntactically correct, but has an internal structure that complies with the model structure that is declared in the DTD or Schema. So, a valid XML document is a well-formed XML document that also conforms to the declarations, structures, and other rules defined in the document's respective DTD or schema.

Well-formed XML documents meet the W3C's specific grammatical, logical, and structural rules outlined in the W3C's XML 1.0 Recommendation. The W3C has judged that a fatal error has occurred if and when a confirming XML processor detects that an XML document violates the recommended well-formed constraints.

  • A valid XML document is a well-formed XML document that also conforms to the rules defined in a document type definitions (DTD), or an XML schema.

  • A document, that is well-formed, however, may not be valid.

  • A well-formed XML document has to follow several rules such as :

    • Only one root element.
    • Proper Nesting.
    • Well-formed entities.

  • Validation is particularly important when the destination of an XML document needs to know that the data being received is according to the standard structure it expects.

  • If there is a reference to a DTD or schema in an XML document, any program that reads, understands, and helps to do something useful with an XML document can validate the document or choose to ignore it.

  • Such programs, typically called parsers, may or may not have the capacity to validate an XML document.

If parsers can validate, they are called Validating Parsers and if they cannot, they are called Non-validating Parsers.

XML Validator

You can syntax-check your XML files by just pasting your XML document into the text field provided in the URL below :


and hit the validate button. If the document is too large to be conveniently pasted into the text field, enter its filename into the local file field. You may also validate an arbitrary XML document on the Web by typing its URI into the URI field.



In this chapter you have learnt:

  • About DTD and its importance.
  • Types of DTDs associated with an XML document.
  • About XML schema and how are they different from XML DTDs
  • Importance of a valid document
  • Role of an XML validator.
Review Questions

Fill in the Blanks

  1. ________ and ________ are models of the logical structure of the content of an XML document.
  2. The DTD name is similar to the ________ element name of XML document.
  3. _______ contains only one DTD.
  4. _______ DTDs are included inside XML source file.
  5. Two types of parsers are ________ and________.


  1. DTD and Schema
  2. root
  3. HTML
  4. Internal
  5. Validating parsers and Non validating parsers


True or False

  1. The DTD name should always match the root element name except for external DTDs.
  2. For internal DTD, the standalone parameter in the XML version statement is set to "no".
  3. External DTD can be shared by more than one XML documents.
  4. Schema has non-XML syntax.
  5. A well-formed XML document is always a valid XML document.
  1. False
  2. False
  3. True
  4. False
  5. False


What's Next
The next chapter will acquaint you with the basic concept of various browsers and their support for XML. The chapter will further elucidate how an XML file would be viewed in a browser.

               Hop over to the next chapter to get a close-up of browsers that support XML.

Home  |  About Us  |  Privacy Policy  |  Site Map  |  FAQs  |  Contact Us
© ExpertRating 2015. All Rights Reserved.