Computer Knowledge
Markup and Web Languages
1,492 Questions
Test your understanding of HTML tags, XML structures, and web page creation technologies. The questions cover elements like CSS styling, parsing documents, and defining web attributes. This section is essential for candidates appearing for computer proficiency tests in various competitive exams.
HTML tags and attributesXML document parsingCSS styling levelsWeb page creation basicsBrowser compatibility
Markup and Web Languages Questions
B
Correct answer
Explanation
In XML, all elements must be properly closed, either with an end tag or as self-closing elements. This is different from HTML where some elements don't require closing tags. XML's strict well-formedness rules require all elements to be closed.
B
Correct answer
Explanation
XML tags are case-sensitive, meaning , , and are treated as three different tags. This is a fundamental XML rule designed to prevent ambiguity. The statement claims tags are NOT case-sensitive, which is false.
A
Correct answer
Explanation
XML element names must follow specific naming rules: they can contain letters, digits, hyphens, underscores, and periods; must start with a letter or underscore; cannot contain spaces; and cannot begin with 'xml' in any case combination. These rules ensure XML parsers can reliably process documents.
B
Correct answer
Explanation
There's a distinction between 'well-formed' XML (correct syntax) and 'valid' XML (well-formed + conforms to DTD/schema). A document can be well-formed without being validated against a DTD. Validating against a DTD makes it 'valid' XML, not just 'well-formed' - it must already be well-formed to even be validated.
A
Correct answer
Explanation
CSS can be applied to XML documents to control display, formatting, and presentation. This is commonly done by linking a stylesheet using the processing instruction. CSS styles XML elements by tag name, allowing XML data to be rendered visually in web browsers or other applications.
-
<jsp:setColor id="fruit" property="color" value="white"/>
-
<jsp:setColor name="fruit" property="color" value="white"/>
-
<jsp:setValue name="fruit" property="color" value="white"/>
-
<jsp:setProperty name="fruit" property="color" value="white">
-
<jsp:setProperty name="fruit" property="color" value="white"/>
E
Correct answer
Explanation
The correct JSP syntax for setting bean properties is . The element name is setProperty, not setColor or setValue. Option D is missing the closing slash.
-
XPathDocument class is very fast, but it is read-only
-
The XmlDocument class provides editable representation of XML document, but is comparatively slower.
-
XPathNavigator object can be created using both XPathDocument and XmlDocument classes, which can be used to to select and navigate XML data.
-
None of the above
D
Correct answer
Explanation
All statements are true: XPathDocument is a fast, read-only cache; XmlDocument is editable but slower; and XPathNavigator can navigate both. Thus, 'None of the above' is the correct false statement.
-
a. Java
-
b. .Net
-
c. XML
-
d. A & B
C
Correct answer
Explanation
SOAP (Simple Object Access Protocol) is a messaging protocol specification that is strictly based on XML for its message format.
-
a. The Soap Message Format
-
b. How to send message and receive response
-
c. Data Encoding
-
d. A & B only
-
e. All Of the above
E
Correct answer
Explanation
The SOAP specification defines the XML envelope format, the data encoding rules, and the conventions for representing remote procedure calls and responses.
A
Correct answer
Explanation
The SOAP Envelope is the root element of every SOAP message and is mandatory according to the SOAP specification. It encapsulates the entire message and defines the XML namespace for SOAP. Without an Envelope, a message is not a valid SOAP message.
B
Correct answer
Explanation
The SOAP Header is an optional element in a SOAP message. While the Envelope and Body are mandatory, the Header is used only when you need to convey additional information such as authentication, transaction context, or processing instructions. Many simple SOAP messages have no Header at all.
A
Correct answer
Explanation
The SOAP Body element is mandatory and contains the actual message content - the XML data being exchanged between the sender and receiver. Every valid SOAP message must have a Body element that holds the primary information intended for the message recipient.
A
Correct answer
Explanation
The SOAP Header element is specifically designed to convey optional, application-specific, and infrastructure-related information. Headers are used for metadata like authentication tokens, routing information, transaction contexts, or other processing directives that are separate from the main message payload in the Body.
-
a. WSDL is a standard format for describing XML Webservices.
-
b. WSDL defines XML based syntax for defining the functionality exposed by a web service.
-
c. WSDL is useful for automating communications between Web Services.
-
d. All of above
D
Correct answer
Explanation
WSDL (Web Services Description Language) serves multiple purposes: it provides a standard XML format for describing web services (A), defines XML-based syntax for specifying web service functionality (B), and enables automation of web service communications (C). Since all three statements are correct, D is the right choice.
-
a. RPC based format
-
b. Document based format
-
c. both a and b.
-
d. They cannot be serialized.
C
Correct answer
Explanation
SOAP messages can be serialized in two main styles: RPC (Remote Procedure Call) style, which models a traditional procedure call with parameters and return values, and Document style, which sends entire XML documents. The CHOICE between these is referred to as the 'use' or 'encoding style' in SOAP. The correct answer acknowledges both RPC and Document-based formatting are valid.