Computer Knowledge
Markup and Web Languages
1,701 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
A
Correct answer
Explanation
JSP allows embedding pure Java code through scriptlets (<% ... %>). You can write any valid Java code inside these scriptlet blocks. However, this is considered poor practice in modern JSP development - JSTL tags, EL expressions, and MVC patterns are preferred. The question asks about capability, not best practices.
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
Modern servlet containers automatically map JSP files - you don't need to configure them in web.xml. The container compiles JSPs into servlets on first access. web.xml configuration is only needed for Servlets and custom URL mappings.
-
<% code %>
-
<@jsp code %>
-
<jsp: scriptlet code />
-
<%jsp code %>
A
Correct answer
Explanation
The scriptlet element syntax in JSP is <% code %>. Scriptlets allow embedding Java code directly into JSP pages. The code inside runs during the request processing phase and can generate dynamic content.
-
<%-- comment --%>
-
<!-- comment -->
-
<% // comment %>
-
<% /* comment */ %>
-
<% /** comment */ %>
A
Correct answer
Explanation
JSP comments use <%-- comment --%>. These are server-side comments that are completely removed from the generated HTML - the browser never sees them. HTML comments would be visible to users viewing page source.
-
Intelligent field selection will use IDs, names, or XPath as needed
-
Can't debug and set breakpoints
-
Save tests as HTML, Ruby scripts, or other formats
-
Option to automatically assert the title of every page
-
speed up database queries
-
encrypt passwords
-
transform XML into HTML
-
cache html pages
C
Correct answer
Explanation
XSLT (Extensible Stylesheet Language Transformations) is designed specifically for transforming XML documents into other formats, most commonly HTML for web display. It uses templates and XPath to match and convert XML structure. Options A (database), B (encryption), and D (caching) are unrelated to XSLT's purpose.
-
Extensible Book Notation Format
-
a replacement for the SAX XML parser
-
the leader of the free software foundation
-
a syntax for defining grammar
D
Correct answer
Explanation
EBNF (Extended Backus-Naur Form) is a notation for formally defining the grammar of programming languages and other formal languages. It extends the original BNF notation with additional features like repetition, optional elements, and grouping, making it more expressive for specifying syntax rules.
-
Parse Data
-
Parse XML
-
Render XML
-
Transform XML
D
Correct answer
Explanation
The Transform XML activity is the resource that uses the Saxon-B XSLT 2.0 engine for XSLT transformations in TIBCO BusinessWorks. Parse Data and Parse XML are for parsing different formats, and Render XML is for generating XML output - none of these involve XSLT transformation engines.
-
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 refers to the process where the JSP container converts the JSP file into a corresponding Servlet source code. This generated servlet is then compiled. The servlet handles requests by generating HTML output. Option A is wrong because JSP uses its own parser, not generic XML. Option B is wrong because JSP becomes dynamic servlet code, not static HTML.
A
Correct answer
Explanation
JSP (JavaServer Pages) allows embedding Java code directly within the page using scriptlets (<% %>) and expressions (<%= %>). You can write pure Java code including variable declarations, method calls, control flow statements, and expressions. The JSP container translates this Java code into servlet code during compilation.
B
Correct answer
Explanation
JSP pages can include both other JSP pages and HTML pages. The standard action can include any resource, including HTML pages, at runtime. The <%@ include %> directive can include static content like HTML files at translation time. There is no restriction that only JSP pages can be included.
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.