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
-
JavaScript
-
VBScript
-
Both of the above
-
None of the above
C
Correct answer
Explanation
Security APIs commonly support scripting languages like JavaScript and VBScript for dynamic content execution and security validation. Option C correctly identifies both as standard supported codecs in many security frameworks.
-
isSafeHTML(java.lang.String context, java.lang.String input, boolean allowNull) and encodeForHTML(java.lang.String input)
-
isSafeHTML(java.lang.String context, java.lang.String input)
-
SafeHTML(java.lang.String context, java.lang.String input)
-
ValidHTML(java.lang.String context, java.lang.String input)
A
Correct answer
Explanation
To prevent XSS, TCS SAPI uses both isSafeHTML() to validate input and encodeForHTML() to encode it. Validation alone is insufficient - encoding is necessary to neutralize malicious scripts. The correct option A includes both prevention methods.
-
JavaScript
-
VBScript
-
Both of the above
-
None of the above
C
Correct answer
Explanation
The security API includes default scripting codecs for both JavaScript (JavaScriptCodec) and VBScript (VBScriptCodec). These codecs encode user-supplied data specifically for execution within client-side script contexts, preventing cross-site scripting (XSS) attacks by neutralising script-specific characters before output rendering.
-
isSafeHTML(java.lang.String context, java.lang.String input, boolean allowNull) and encodeForHTML(java.lang.String input)
-
isSafeHTML(java.lang.String context, java.lang.String input)
-
SafeHTML(java.lang.String context, java.lang.String input)
-
ValidHTML(java.lang.String context, java.lang.String input)
A
Correct answer
Explanation
The TCS SAPI provides isSafeHTML() and encodeForHTML() methods to prevent Cross Site Scripting (XSS) attacks. The isSafeHTML() method validates HTML content against a context to ensure it's safe, while encodeForHTML() encodes potentially dangerous characters to prevent script injection. Using these methods together provides comprehensive XSS protection.
-
Home Tool Markup Language
-
Hyperlinks and Text Markup Language
-
Hyper Text Markup Language
-
None
C
Correct answer
Explanation
HTML stands for Hyper Text Markup Language. It's the standard markup language for creating web pages. Option A is incorrect, and B incorrectly states 'Hyperlinks' instead of 'Hyper Text'.
-
<head>
-
<heading>
-
<h6>
-
<h1>
D
Correct answer
Explanation
HTML uses
through tags for headings, with being the largest and most important. The tag contains metadata, not headings. There is no tag in HTML, and is the smallest heading.
B
Correct answer
Explanation
The
tag is the correct HTML element for line breaks. There is no or tag in HTML. The self-closing form with space before slash is XHTML-compatible practice.
-
XML
-
Perl
-
Java
-
.Net
-
Bea Portal
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.
-
<Script> tags
-
<font> tags
-
<Body> tags
-
<Head> tags
-
Store data
-
Write data
-
Read data
-
Read and write data
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.
-
Swf will not be published
-
Data will not be shown in swf
-
Data will be displayed in swf file
-
Swf will generate a new xml file automatically
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.
-
Length
-
Format
-
Informat
-
Label
A,B,C,D
Correct answer
Explanation
In SAS, variable attributes define the properties of a variable. The name identifies the variable, type determines if it's numeric or character, length defines storage size, label provides a descriptive text, format controls output appearance, and informat specifies how to read raw data values. All four options listed are valid SAS variable attributes.
-
ruby script/generate scaffold recipe [name,type] => [string,string]
-
ruby scaffold recipe [name,type] => [string,string]
-
ruby script/generate scaffold recipe name=string type=string
-
ruby script/generate scaffold recipe name:string type:string
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.
-
JavaScript
-
VBScript
-
Both of the above
-
None of the above
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.
-
isSafeHTML(java.lang.String context, java.lang.String input, boolean allowNull) and encodeForHTML(java.lang.String input)
-
isSafeHTML(java.lang.String context, java.lang.String input)
-
SafeHTML(java.lang.String context, java.lang.String input)
-
ValidHTML(java.lang.String context, java.lang.String input)
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.