Learnthat.com Free Certification and Computer Online Courses
ThatNetwork.com Internet Media Network Exampractice.com free certification practice exams, mcse, comptia Definethat.com - Free technical definitions, define Free Romance Tips, Romantic Tips, Date Ideas Free POD publisher comparison print on demand
Learnthat.com Free A+ Certification, Computer Classes, Certification Courses, Business, Lifestyle, ApplicationsFree business tutorials and definitionsFree certification tutorials and definitionsFree computer and technical tutorials and technical definitionsFree Finance Tutorials and DefinitionsFree House Repair TutorialsFree Lifestyle and Fun Tutorials
  All Online CoursesNew Courses QuickTipsWord DefinitionsSubmit a TutorialLinks
÷ Resources
Home
free tech tutorials
Free Tutorials
free tech tutorials
Certifications
free tech tutorials
Definitions
free tech tutorials
Resources/Links
free tech tutorials
Forums
free tech tutorials
Distance Education
free tech tutorials
Highest Rated Tutorials
÷ Popular Tutorials
÷ New Tutorials

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:

DefineThat.com Technical Defintions Romancetips.com
Free Gift Ideas - GiveThat Planthat.com Free Unique Business Ideas
PublishOnDemand.net - Learn about Print on Demand (POD) - Self Publishing Seekthat.com - Technical Search Engine
ThatNetwork.com  

About Us : Contact Us : Advertise : Privacy Information

© 1998-2004 Learnthat.com