How to write comment in XML?

How to write comment in XML?

We use comment in XML to temporary write the note or want some code to edit on XML document.Some time writing a comment is very necessary for program.

 XML does not provide any special method for writing a comment it is same as HTML.Below I have given a code how to write comment on XML.

Example:

<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>

<!-- Student that marks on half yearly exam  -->

<class_student_list>

    <student>

<name>Hariom</name>

<score>70%</score>

    </student>

    <student>

<name>Abhi</name>

<score>75%</score>

    </student>

</class_student_list>

 Below I have given you a example in this i have remove some data about student temporarily.

Example:


<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>

<!-- Student that marks on half yearly exam  -->

<class_student_list>

    <student>

<name>Hariom</name>

  <!--  <score>70%</score>  -->

    </student>

    <student>

<name>Abhi</name>

  <!--  <score>75%</score>  -->

    </student>

</class_student_list>

 In this I have remove score temporarily. 


By:Vivek
Date:2014-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related XML Subjective Links

XML Subjective interview questions and answers for experienced and fresher