XML Tutorials
  Home arrow XML Tutorials arrow Page 4 - 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) - Whitespace


    (Page 4 of 4 )

     

    I will not spend much time on white space. White space is spaces and line breaks, carriage feeds, and tabs. It is okay to include it outside of your elements, so that it is easier to read. But do not include it inside of your elements, as it can cause errors in certain instances. For example: 

    <albums>

     

    <album></album>

     

    </albums> 

    is okay. Above we have used line breaks to space out our elements for easier reading, and a tab indent to make it more noticeable that <album></album> is a child of <albums>. An incorrect way to write the above would be like this: 

    <albums>

     

    <album > </ album>

     

    </albums> 

    Instructions for Processing 

    These are used to give instruction to the processor that is processing your XML document. Here is an example of how to write one: 

    <?name data?> 

    We will further discuss these in a later article. For now, here is an example of how you would use your instructions to get a stylesheet: 

    <?xml:stylesheet type=”text/css” href=”albums.css”?> 

    Final Words 

    That is it for this article. In the next article you will learn to read a DTD and declare elements. You will also learn about entities and how to use them. The article following that will go into a discussion on how to write XML Schemas and whether you should use them instead of DTDs. 

    Thank you for reading my article. If you have comments or questions, please feel free to leave them.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · 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 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek