1

I know it is possible to comment somethin in XML like this:

<?xml version = "1.0" encoding = "UTF-8" ?>
<!--Students grades are uploaded by months-->
<class_list>
   <student>
      <name>Tanmay</name>
      <grade>A</grade>
   </student>
   <!--
   <student>
      <name>Tanmay 2</name>
      <grade>C</grade>
   </student>
   -->
</class_list>

But if I wanted to comment all students and preserve the current comments? Like this it isnt possible:

<?xml version = "1.0" encoding = "UTF-8" ?>
<!--Students grades are uploaded by months-->
<class_list>
<!-- this would comment the whole <student> stuff
   <student>
      <name>Tanmay</name>
      <grade>A</grade>
   </student>
   <!-- a comment now:
   <student>
      <name>Tanmay 2</name>
      <grade>C</grade>
   </student>
   -->
-->
</class_list>

In C++ and Java e.g. we can comment like this:

// for inside blockers

and /* */ this will comment over the // blocks

int exampleSum(int a, int b) 
{
    // do something
    return a + b;
}

So I could comment the whole method

/*
int exampleSum(int a, int b) 
{
    // do something
    return a + b;
}
*/

Is there a way to do that in XML?

felipe
  • 1,212
  • 1
  • 15
  • 27

0 Answers0