![]() |
|
| • All Online Courses • New Courses • QuickTips • Word Definitions • Submit a Tutorial • Links • |
|
Learn XML programming in this free XML training course Section 6: XML Best PracticeWhat are valid XML documents?There are several places in an XML document where it can run into problems. A valid document is one that has no runtime problems, all of the code is properly formatted, and all of the referenced materials are properly defined. To create a valid XML document, you need to create a DTD… for those who might dislike DTD’s this can be a bit of a hassle, but it’s necessary if the program reading the XML document is going to know what all of the definitions for the elements are and how best to use them. A valid XML document must also be accompanied by a stylesheet, whether it’s CSS or XSL. This is so that the document can be formatted for the screen or program properly, and so that all of the elements defined by the DTD are used properly. Open up your preferred text editor or XML editor, and begin a new document. Make your XML declaration, reference a stylesheet (it can be a made-up stylesheet name for this exercise), and then create a short inline DTD (defining at least 3 elements.) Once you’ve finished this, go ahead and create a brief XML document, choosing one of your elements as a root element and placing some brief content within the other two. Your finished document should look a little something like this:
If you wish, you could then go in and create your stylesheet file so that the document will run as a valid document.
by John Casteele Find more free Internet tutorials from Learnthat.com. More Information:
Help us by rating this tutorial: [---] [--] [+] [++] [+++] [---] lowest; [+++] highest
|
|
||||||
![]() |
Learn: Free
Tutorials - Links
to Free Tutorials
Understand: Free Technical Definitions
- ExplainThat Whitepapers
Use: Certification Section -
Discussion Forum
Visit Our Network Sites:
About Us : Contact Us : Advertise : Privacy Information