Q: 1 Which of the following is not required for an XML document to be well-formed?
All XML documents have to be validated against a DTD
All XML tags are case-sensitive
All XML elements must be properly nested
All XML elements must have a closing tag
[ Option A ]
A well-formed XML document follows basic syntax rules, but it does not require validation against a DTD (Document Type Definition). Validation is optional and is needed only for a valid XML document, not just a well-formed one.
Rules for a well-formed XML:
Q: 2 Which of the following Xpath expression selects the attribute?
@
&
%
$
[ Option A ]
In XPath, the @ symbol is specifically used to select attributes of an element rather than the element itself. Attributes provide additional information about elements and are accessed differently from child nodes.
For example, given the XML element <student id="101" name="Suresh"/>, the XPath expression /student/@id is used to select the id attribute of the student element, which returns the value 101.
| Symbol | Purpose |
|---|---|
| @ | Select attribute. |
| / | Select root/child nodes. |
| // | Select nodes anywhere. |
| * | Select all elements. |
Q: 3 Information from web page stored in server side is called _________.
Cookies
Session
Servlet
Credentials
[ Option B ]
In web applications, user-related information can be stored either on the client side or the server side.
A session is a server-side storage mechanism used to store user data temporarily while the user interacts with a website. The data is stored on the server and is associated with a unique Session ID.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.