![]() |
|
| • All Online Courses • New Courses • QuickTips • Word Definitions • Submit a Tutorial • Links • |
|
Learn XML programming in this free XML training course How do you use comments?Good use of comments can make troubleshooting and reading code much easier. Comments can tell you what each section of elements does, which attributes are used for what, and can also contain copyright and author information. As an example, let’s refer to the dog example that I used earlier. You might remember that it looked something like this: <?xml version=”1.0”?> <?xml-stylesheet type=”text/css” href=”dogs.css”?> <dogs_info> <dogs>Tamerlane, Shadow, and Jake are wonderful dogs!</dogs> <neighbor_dogs>Of course, Lucy and Sarah are good dogs, too.</neighbor_dogs> </dogs_info> Using comments, add a little information about the creator of the file, when it was made, and a description of what the dogs_info element is going to contain. Don’t forget to be careful where you place your comments, and remember to close them when you’re done. The commented version might look something like this: <!- - Copyright 2005 AnotherPuppyPage.net - -> <?xml version=”1.0”?> <?xml-stylesheet type=”text/css” href=”dogs.css”?> <!- - Information about my favorite dogs - -> <dogs_info> <dogs>Tamerlane, Shadow, and Jake are wonderful dogs!</dogs> <neighbor_dogs>Of course, Lucy and Sarah are good dogs, too.</neighbor_dogs> </dogs_info> Someone else reading the source file would then be able to easily determine who created the file, when, and what was coming without having to read all of the information contained within the root element.
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