XML Tutorials
  Home arrow XML Tutorials arrow Validation with Document Type Definiti...
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML TUTORIALS

Validation with Document Type Definitions (DTDs)
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2009-02-25

    Table of Contents:
  • Validation with Document Type Definitions (DTDs)
  • Getting to Know DTDs
  • Creating an XML Prolog
  • Whitespace

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Validation with Document Type Definitions (DTDs)


    (Page 1 of 4 )

    In this article you will learn to work with Document Type Definitions or DTDs. These allow you to validate your XML documents which are well-formed. XML document descriptions (which is what DTDs and Schemas are), are statements that decide how content can/must appear in your XML documents. The document descriptions are read by software and then your document is checked against this description to ensure that all of the rules are followed.

    In our previous article we learned how to create well-formed XML documents, and learned the rules to ensure we created them properly. We also touched further upon the hierarchy structure of the parent, child, and sibling scheme.

    About Document Descriptions

    Document descriptions are a form of metadata because they contain data that helps to describe other data. Below is a list of data you can expect to find in your document descriptions: 

    1. Some description of the elements that exist in your document.

    2. A description of the kind of content that your elements can have.

    3. The order in which your elements can/must appear in your document.

    4. A range that element attribute values must contain or content values elements must have.

    5. How many times an element may occur.

    6. A guide to the relationships of the various elements that exist in your document. 

    In short, these metadata or definitions hold the rules for describing your data, and not the actual data itself. 

    Should You Create a Document Description? 

    Here is a list of reasons why you might wish to create a document description. It is not mandatory to do so by any means, so take these reasons into consideration when deciding if you should create one or not: 

    1. If you need to specify certain types of content not available somewhere else.

    2. If you want to have a set of rules for your document and have the ability to ensure those rules are being followed. Your document description makes this an automated task.

    3. If you have definitive data to collect, store, or organize.

    4. You wish to create a new industry standard.

    5. If the data you collect is unwieldy or complicated. 

    You probably should not use a document description if the following applies to you: 

    1. There is already a document description that fits your needs.

    2. If you only have a single or simple document, there is no need to complicate matters with a document description.

    3. If you are working with a relatively small and simple amount of data. 

    More XML Tutorials Articles
    More By James Payne


       · I think that someone needs to proof-read this article - none of the examples seem to...
       · I agree - I think there are some problems with this series of articles. I can spot a...
     

    XML TUTORIALS ARTICLES

    - Validation with Document Type Definitions (D...
    - Creating a Well-Formed XML Document
    - Creating XML Taxonomies
    - Getting to Know XML
    - A Friendly Approach to XML
    - Creating RSS 2.0 Feeds
    - Using Modules in Your RSS Feed
    - RSS 2.0
    - Querying XML: Use Cases
    - Joins and Query Use with XML
    - Solving Problems by Querying XML
    - Performing Set Operations When Querying XML
    - Querying XML
    - Handling Data for Ajax with JSON
    - Handling XML Data for Ajax





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek