Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

Comment Your XML

By Jennifer Kyrnin, About.com

Comments in XML are nearly identical to comments in HTML. Using comments allows you to understand code you wrote years before, or another developer to review.
Difficulty: Easy
Time Required: 5 minutes

Here's How:

  1. Add the first part of the comment tag

Tips:

  1. Comments cannot come at the very top of your document. In XML, only the XML declaration can come first:
  2. Comments may not be nested one inside another. You must close your first comment before you open a second.
  3. Comments cannot occur within tags, e.g. .
  4. Never use the two dashes (--) anywhere but at the beginning and end of your comments.
  5. Anything in comments is effectively invisible to the XML parser, so be very careful that what remains is still valid and well-formed.

Explore Web Design / HTML

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2009 About.com, a part of The New York Times Company.

All rights reserved.