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
Modern servlet containers automatically recognize and compile JSP files without requiring explicit configuration in web.xml. JSP files can be placed in the application and accessed directly by their URL, making web.xml configuration unnecessary.
-
<% code %>
-
<@jsp code %>
-
<jsp: scriptlet code />
-
<%jsp code %>
A
Correct answer
Explanation
A JSP scriptlet is used to insert Java code into a JSP page and is enclosed within <% and %> delimiters. Other options like <@jsp code %> or <%jsp code %> are syntactically invalid, and `` is the XML equivalent but not styled as shown in the distractors.
-
<%-- comment --%>
-
<!-- comment -->
-
<% // comment %>
-
<% /* comment */ %>
-
<% /** comment */ %>
A
Correct answer
Explanation
JSP comments are server-side comments that use the syntax <%-- comment --%>. These comments are completely removed from the generated output and never sent to the client. HTML comments are client-side and remain in the response. Java-style comments <% // %> or <% /* */ %> are scriptlet code, not JSP comments.
-
Parsing JSP using an XML Parser.
-
Converting JSP into static Html content.
-
Generating Servlet Code for the Jsp
-
None
C
Correct answer
Explanation
JSP translation is the first phase in the JSP lifecycle where the JSP container parses the JSP file and translates it into a Java Servlet source file (.java). This generated servlet is then compiled and executed to handle requests and generate dynamic HTML output.
A
Correct answer
Explanation
JSP supports Java code through scriptlets (<% ... %>) and expressions (<%= ... %>). You can write pure Java code directly within these tags. However, best practices recommend minimizing scriptlets in favor of JSTL and custom tags for better separation of concerns.
B
Correct answer
Explanation
JSP pages can include both JSP pages AND HTML pages using directives like or <%@ include %>. The statement claims inclusion is restricted to JSP only, which is incorrect. Therefore the answer is False.
B
Correct answer
Explanation
JSP files do not need explicit configuration in web.xml because modern servlet containers automatically handle them. When a JSP is first accessed, the container translates it into a servlet and compiles it. The JSP engine built into the container processes JSP files without requiring manual mapping or configuration.
-
<% code %>
-
<@jsp code %>
-
<jsp: scriptlet code />
-
<%jsp code %>
A
Correct answer
Explanation
JSP scriptlets use the syntax <% code %> to embed Java code that executes during page generation. The percentage symbols distinguish scriptlets from other JSP elements. Other options are incorrect - @jsp is not a valid prefix, and jsp:scriptlet is for XML-style actions, not scriptlets. Scriptlets are one of three main JSP scripting elements.
-
SOAP is based on XML format
-
SOAP is platform dependant.
-
SOAP is language independent.
-
SOAP is non extensible protocol.
-
SOAP is compatible with Java alone.
A
Correct answer
Explanation
WSDL (Web Services Description Language) is the standard for describing the structure of XML data exchanged between systems using SOAP. It defines the message format, operations, and protocol bindings. UDDI is for registry services, SAAJ is for SOAP messaging, and JAXR is for registry access.
A
Correct answer
Explanation
The XML document shown is valid. It has a proper XML declaration (), a single root element (
), properly nested and closed child elements (, , , ), and well-formed structure with matching tags.
-
To validate if the XML is well formed.
-
To pretty print the XML.
-
To include HTML in an XML Document without getting parsed.
-
It provides a qualified name for an XML element or attribute.
C
Correct answer
Explanation
CDATA sections allow you to include text containing special characters like <, >, & that would otherwise be parsed as XML markup. This is useful when embedding HTML, JavaScript, or other code within XML documents. The parser treats everything inside CDATA as literal text.
-
Add Security to SOAP.
-
To validate if the XML is well formed.
-
To Avoid Element Name Collisions.
-
None of the above.
C
Correct answer
Explanation
XML namespaces provide a way to uniquely identify elements and attributes to prevent naming conflicts when documents from different sources are combined. By qualifying names with a URI prefix, you can have two elements with the same local name but different meanings. This is essential in technologies like SOAP and XSLT.
-
JQuery.
-
DOJO.
-
Both a and b.
-
None of the above.
C
Correct answer
Explanation
jQuery and Dojo (DOJO) are both popular JavaScript libraries used for AJAX development. jQuery provides the ajax() method and shortcuts like get()/post(), while Dojo Toolkit includes XMLHttpRequest wrappers and AJAX utilities. Both are widely used, making Option C correct.
B
Correct answer
Explanation
While AJAX originally used XML for data exchange (hence the name Asynchronous JavaScript and XML), modern AJAX applications commonly use JSON, plain text, or other formats. However, among the given options, XML is the most historically accurate answer representing what the 'X' in AJAX stands for. MQ is a messaging protocol, and Java is a programming language.