DSSSB TGT CS 2023 Shift 2 – Question 179

Question:

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

निम्नलिखित में से किस कमांड का उपयोग XML फाइल में मल्टीपल लाइन्स (अनेक लाइनों) को कमेंट करने के लिए किया जाता है?

Options:

  • <!– This is a
    multi-line
    XML comment –>
  • /*
    This XML file
    contains a list
    of custom information
    */
  • //
    This is a
    multi-line
    XML comment
    //
  • <–
    This XML file
    contains a list
    of custom information
    –>
  • <!– This is a
    multi-line
    XML comment –>
  • /*
    This XML file
    contains a list
    of custom information
    */
  • //
    This is a
    multi-line
    XML comment
    //
  • <–
    This XML file
    contains a list
    of custom information
    –>

Correct Answer: a)

Explanation:

In XML (Extensible Markup Language), comments must begin with the sequence &lt;!-- and terminate with --&gt;. XML comments can span single or multiple lines, and the XML parser ignores everything inside these delimiter tags.

– /* ... */ and // are comment delimiters in languages like C, C++, Java, and JavaScript, not XML.
– &lt;-- ... --&gt; is invalid XML syntax (missing the exclamation mark !).

Therefore, option a) shows the correct multi-line comment format in XML.

XML (एक्सटेंसिबल मार्कअप लैंग्वेज) में कमेंट्स को शुरू करने के लिए &lt;!-- और समाप्त करने के लिए --&gt; का उपयोग किया जाता है। यह सिंटैक्स एकल पंक्ति और बहु-पंक्ति (multi-line) दोनों टिप्पणियों के लिए मान्य होता है।

– /* ... */ और // का प्रयोग C, C++, Java आदि प्रोग्रामिंग भाषाओं में किया जाता है, XML में नहीं।
– &lt;-- ... --&gt; अमान्य सिंटैक्स है क्योंकि इसमें विस्मयादिबोधक चिह्न (!) नहीं है।

अतः सही उत्तर विकल्प a) है।

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top