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 <!-- and terminate with -->. 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.
– <-- ... --> is invalid XML syntax (missing the exclamation mark !).
Therefore, option a) shows the correct multi-line comment format in XML.
XML (एक्सटेंसिबल मार्कअप लैंग्वेज) में कमेंट्स को शुरू करने के लिए <!-- और समाप्त करने के लिए --> का उपयोग किया जाता है। यह सिंटैक्स एकल पंक्ति और बहु-पंक्ति (multi-line) दोनों टिप्पणियों के लिए मान्य होता है।
– /* ... */ और // का प्रयोग C, C++, Java आदि प्रोग्रामिंग भाषाओं में किया जाता है, XML में नहीं।
– <-- ... --> अमान्य सिंटैक्स है क्योंकि इसमें विस्मयादिबोधक चिह्न (!) नहीं है।
अतः सही उत्तर विकल्प a) है।