Comments in xml

Comments

Although XML is considered to be self-describing data, there are still some cases where a writer may want to use comments.  Comments are used to make notes about or to temporarily edit out sections of code. Comments in XML use the same comment syntax as that used in HTML code.  The examples below shows how comments can be used for these two purposes.

Example: Descriptive Comment

<!– Employee checks are distributed bi-weekly –>

<employee_list>

<employee>

<name>John</name>

<pay>$50,000</pay>

</employee>

<employee>

<name>Jane</name>

<pay>$60,000</pay>

</employee>

</employee _list>

Example: Temporary Editing Out Code

<employee_list>

<!–

<employee>

<name>John</name>

<pay>$50,000</pay>

</employee>

–>

<employee>

<name>Jane</name>

<pay>$60,000</pay>

</employee>

</employee _list>

This entry was posted in XML Tutorial. Bookmark the permalink.

Leave a Reply

Your email address will not be published.