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
-
Java
-
ASP.Net
-
Perl
-
All of the above
D
Correct answer
Explanation
Cross-Site Scripting (XSS) is a vulnerability that can affect ANY web programming language, not just specific ones. XSS occurs when applications output user-supplied data without proper encoding or validation, allowing malicious scripts to run in victims' browsers. Options A, B, and C are all vulnerable to XSS - the issue is how the language is used, not the language itself. All web frameworks need XSS defenses.
-
WADL, WSDL, SAML
-
UDDI, WADL, WSDL
-
SOAP, SAML, WADL
-
WSDL, SOAP, SAML
D
Correct answer
Explanation
Web services rely on core standards: WSDL describes service interfaces, SOAP defines the message format and protocol, and SAML handles authentication and authorization assertions. These three work together - WSDL tells clients how to call the service, SOAP carries the actual XML messages, and SAML provides identity security. UDDI and WADL are optional or less central to the core web services architecture.
-
Is a good programming practice
-
Is very useful during code reviews
-
Is the recommended practice for secure code maintenance
-
May give the attacker valuable information to perform an exploit
D
Correct answer
Explanation
Comments in HTML source code can reveal internal implementation details, file paths, server information, or logic that helps attackers understand the application structure and identify vulnerabilities. In production environments, this information should be removed or minimized.
-
a. Select the elements for which a template is applied; used with the element xsl:template
-
b. Select a variable; used with the element xsl:value-of
-
c. Select a case; used with the element xsl:switch
-
d. Set fire to the XML document
A
Correct answer
Explanation
The match attribute in XSLT is used with xsl:template to select which XML elements the template should be applied to. It defines a pattern that matches nodes in the source XML tree. Options B and C are incorrect because xsl:value-of uses 'select' and there is no xsl:switch element in XSLT (it uses xsl:choose). Option D is clearly incorrect and humorous.
-
a. /type
-
b. /@type
-
c. //@type
-
d. type
C
Correct answer
Explanation
To select the type attribute anywhere in an XML document using XPath, you use //@type. The // operator selects nodes throughout the document, and the @ prefix selects attributes. Option A (/type) would select a type element, option B (/@type) would only select type attributes of the root element, and option D (type) is not valid XPath syntax.
-
a. The transformation will not output anything
-
b. The transformation will throw an error
-
c. The output will be true
-
d. None
A
Correct answer
Explanation
The XSLT transformation will not output anything because the test condition 'employee/name = 'John'' is evaluated in the wrong context. The template match is on '/' (root), so the test looks for employee/name as direct children of root, but the actual path is staff/employee/name. To fix it, the test should be 'staff/employee/name = 'John''. Since the condition fails, the xsl:if block doesn't execute and produces no output.
-
<html:message/>
-
<html:base/>
-
<html:errors/>
-
<html:write/>
C
Correct answer
Explanation
Struts provides the tag to display validation error messages on JSP pages. This custom tag renders error messages stored in the ActionErrors or ActionMessages collection. , , and serve different purposes and are not for validation errors.
A
Correct answer
Explanation
The OWB Browser solution provides pre-built HTML reports for reporting and visualization purposes. This allows users to view metadata, deployment status, and other information through a web interface without creating custom reports from scratch.
-
It's valid navigation rule
-
It will generate RuntimeException due to lack of <from-outcome> tag
-
page.jsp will never be displayed with this navigation rule
-
It's not proper (although it's valid) navigation-rule. It should have <from-outcome> tag
A,D
Correct answer
Explanation
The claimed answers are A and D. This navigation rule is technically valid XML (A is true), but it's incomplete because a navigation case should have a tag to specify when this navigation should occur (D is true). Option B is incorrect because it won't throw RuntimeException - it's syntactically valid. Option C is incorrect because page.jsp could be displayed as a default view or through other means.
A
Correct answer
Explanation
In JSF, if `is omitted from a navigation rule, it defaults to wildcard matching (*), applying to all views. Therefore, both configurations define a global navigation rule that redirects to/page.jsp` whenever the outcome is 'outcome', making them identical in effect.
A
Correct answer
Explanation
Both approaches are equivalent. h:outputFormat is a convenience tag that internally uses f:convertDateTime for date formatting. Wrapping f:convertDateTime inside h:outputText achieves the same result, as the converter applies to the outputText value.
A
Correct answer
Explanation
JSF allows multiple validators to be attached to a single component. You can nest multiple f:validator tags or use the validatorIds attribute with Validator interface implementations. All validators execute in sequence during the Process Validations phase.
B
Correct answer
Explanation
Only ONE converter can be attached to a component. Converters are mutually exclusive - applying a second converter replaces the first. This is because a component can only have one single converted value; multiple converters would create ambiguity about which conversion logic to apply.
B
Correct answer
Explanation
The f:view tag has minimal performance overhead. It's required for JSF pages to establish the JSF context and component tree. The overhead is negligible and necessary - avoiding or reducing f:view scope would break JSF functionality, not improve performance.
B
Correct answer
Explanation
This code is invalid. While the taglib declarations and f:view wrapper are correct, h:commandButton must be inside a form element (h:form) to function. Command buttons require form context to handle action events and submission - this code lacks the required h:form wrapper.