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
-
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.
-
Target
-
Deploy
-
Compile
-
copy
A
Correct answer
Explanation
In Ant build scripts, the Target tag is the fundamental execution unit - you invoke a target to run a specific build process. Targets contain tasks like compile, deploy, copy. When you run 'ant targetname', you're invoking a Target tag. Deploy, Compile, and Copy are tasks within targets, not the invoking mechanism.
-
property
-
file
-
variable
-
declare
A
Correct answer
Explanation
In Ant build scripts, the property tag is used to declare variables. Properties are name-value pairs that can be referenced throughout the build script using ${property.name} syntax. 'file', 'variable', and 'declare' are not valid Ant tags for declaring properties.
D
Correct answer
Explanation
The tag in Apache Ant build tool is specifically designed to display messages to the console during build execution. This is the standard way to output build progress or debug information in Ant build scripts. The other options (print, out, write) are not valid Ant tags for console output.
-
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.
-
<hibernate-mapping>
-
<class>
-
<id>
-
<property>
A
Correct answer
Explanation
The tag is the root element in Hibernate XML mapping files. All class and property mappings are nested within this tag. The , , and tags are child elements used to define specific mappings but cannot appear as the root element.
-
<generator class=”hello”>
-
<property name=”customerId” column=”CUSTOMER_ID”>
-
<class name=”book.sample.vo.PurchaseOrderVO” table=”purchase_order”>
-
<id name=”orderNbr” column=”ORDER_NBR” unsaved-value=”0”>
C
Correct answer
Explanation
The tag in Hibernate mapping files includes a table attribute that specifies the corresponding database table name. While the tag maps individual columns to class attributes, only the tag defines the overall table association. Option C correctly demonstrates this with table="purchase_order".