Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following commands is used to comment out multiple lines in an XML file?

  • A.\(\lt\)!-- This is a multi-line XML comment --\(\gt\)
  • B./* This XML file contains a list of custom information */
  • C.// This is a multi-line XML comment //
  • D.\(\lt\)-- This XML file contains a list of custom information --\(\gt\)

Answer: A

The first option is the right way to comment out multiple lines in XML, using <!-- to open the comment and --> to close it, which can span several lines. The second and third options use the comment styles of C and C++ (/* */ and //), which are not XML comments. The fourth lacks the exclamation mark and so is not a valid comment opening. The two dashes after the opening mark and before the closing mark are part of the syntax, and the text between them is ignored by the XML processor.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.