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

Multiple choice technology security
  1. Java

  2. ASP.Net

  3. Perl

  4. All of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology security
  1. WADL, WSDL, SAML

  2. UDDI, WADL, WSDL

  3. SOAP, SAML, WADL

  4. WSDL, SOAP, SAML

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology security
  1. Is a good programming practice

  2. Is very useful during code reviews

  3. Is the recommended practice for secure code maintenance

  4. May give the attacker valuable information to perform an exploit

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. a. Select the elements for which a template is applied; used with the element xsl:template

  2. b. Select a variable; used with the element xsl:value-of

  3. c. Select a case; used with the element xsl:switch

  4. d. Set fire to the XML document

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. a. /type

  2. b. /@type

  3. c. //@type

  4. d. type

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. a. The transformation will not output anything

  2. b. The transformation will throw an error

  3. c. The output will be true

  4. d. None

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. <html:message/>

  2. <html:base/>

  3. <html:errors/>

  4. <html:write/>

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. It's valid navigation rule

  2. It will generate RuntimeException due to lack of <from-outcome> tag

  3. page.jsp will never be displayed with this navigation rule

  4. It's not proper (although it's valid) navigation-rule. It should have <from-outcome> tag

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.