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

Multiple choice technology enterprise content management
  1. XML

  2. Perl

  3. Java

  4. .Net

  5. Bea Portal

Reveal answer Fill a bubble to check yourself
A,B,C,D,E Correct answer
Explanation

Interwoven TeamSite supports multiple programming languages and platforms including XML for content structure, Perl for scripting, Java for enterprise applications, .NET for Windows integration, and BEA Portal for portal deployment. This multi-platform support is a key enterprise feature.

Multiple choice technology web technology
  1. Store data

  2. Write data

  3. Read data

  4. Read and write data

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

XML files are commonly used with Flash/SWF files to read external data into the application. While XML can technically both read and write data, the option states 'Read data' as the correct answer, which aligns with the most common use case. Flash applications primarily consume XML data to populate content dynamically.

Multiple choice technology web technology
  1. Swf will not be published

  2. Data will not be shown in swf

  3. Data will be displayed in swf file

  4. Swf will generate a new xml file automatically

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

When a SWF file loads data from an external XML file, it reads that data at runtime. If the XML file is deleted after the SWF is published, the SWF cannot access the data source, so the data will not be displayed. The SWF itself remains functional but cannot show the XML-dependent content.

Multiple choice technology web technology
  1. ruby script/generate scaffold recipe [name,type] => [string,string]

  2. ruby scaffold recipe [name,type] => [string,string]

  3. ruby script/generate scaffold recipe name=string type=string

  4. ruby script/generate scaffold recipe name:string type:string

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In Rails (especially older versions with script/generate), scaffolding syntax uses field:type pairs separated by spaces. Option D correctly shows name:string type:string, which specifies two fields with their data types. The other options use incorrect syntax like arrows, equals signs, or malformed type declarations.

Multiple choice technology security
  1. JavaScript

  2. VBScript

  3. Both of the above

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The security API supports both JavaScript and VBScript codecs by default because these are the two most common scripting languages used in cross-site scripting (XSS) attacks. Encoding output for both languages provides comprehensive protection against XSS vulnerabilities. Supporting only one would leave applications vulnerable to attacks using the other.

Multiple choice technology security
  1. isSafeHTML(java.lang.String context, java.lang.String input, boolean allowNull) and encodeForHTML(java.lang.String input)

  2. isSafeHTML(java.lang.String context, java.lang.String input)

  3. SafeHTML(java.lang.String context, java.lang.String input)

  4. ValidHTML(java.lang.String context, java.lang.String input)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To prevent Cross-Site Scripting (XSS) attacks, TCS SAPI provides isSafeHTML() which validates HTML content for dangerous patterns, and encodeForHTML() which encodes special characters to prevent script execution. The isSafeHTML method checks if HTML input is safe for a given context, while encodeForHTML converts characters like < and > to safe HTML entities. Using both provides defense-in-depth against XSS vulnerabilities.

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.