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
-
an jsp-based service IDL
-
an non XML-based service IDL
-
an XML-based service IDL
-
none
C
Correct answer
Explanation
WSDL serves as an Interface Definition Language (IDL) for web services, similar to how CORBA IDL works for distributed objects. Being XML-based makes it platform-independent and readable by both humans and machines. It defines the service contract without exposing implementation details.
-
all validations and requests
-
all Validations
-
all requests
-
None
B
Correct answer
Explanation
In SOAP message structure, the header contains auxiliary information like authentication tokens, transaction IDs, validation rules, and routing information. The actual request or response payload goes in the body section. This separation of concerns keeps metadata separate from core message content.
-
only XML
-
XSD, XML, XML schemas
-
only XSD
-
only XML schemas
B
Correct answer
Explanation
Web services can process various XML-based request formats including plain XML documents, XSD (XML Schema Definition) for structure validation, and XML schemas that define document structure. These formats provide type safety and validation for service messages, ensuring proper data exchange between systems.
-
Java
-
ASP.Net
-
Perl
-
All of the above
D
Correct answer
Explanation
Cross-Site Scripting is a vulnerability that affects any web application technology, not specific languages. Java, ASP.NET, Perl, PHP, Python, Ruby, and JavaScript-based frameworks can all be vulnerable if they improperly handle user input and render it without proper sanitization. The vulnerability is in how the application processes output, not the language itself.
-
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
HTML comments visible in source code can reveal internal application structure, debugging information, file paths, or sensitive implementation details to attackers. Code comments are useful during development but should be removed or minimized in production to prevent information disclosure vulnerabilities.
-
stylesheet>mystyle.css</stylesheet />
-
<link rel="stylesheet" type="text/css" href="mystyle.css">
-
<link rel="stylesheet" type="text/css" src="mystyle.css">
-
<style src="mystyle.css" />
B
Correct answer
Explanation
External style sheets are linked using the element with attributes `rel="stylesheet"`, `type="text/css"`, and `href`. Using `src` instead of `href` is incorrect for links, and tags with src or custom <stylesheet> tags are invalid HTML.
-
<css>
-
<script>
-
<style>
-
<link>
-
body {color: black}
-
{body;color:black}
-
{body:color=black(body}
-
body:color=black
A
Correct answer
Explanation
CSS syntax uses the format: selector { property: value; }. The correct form is 'body { color: black; }' where 'body' is the selector, 'color' is the property, and 'black' is the value.
-
p {font-weight:bold}
-
<p style="font-size:bold">
-
p {text-size:bold}
-
<p style="text-size:bold">
A
Correct answer
Explanation
The correct CSS property for making text bold is font-weight with value bold. Option A uses the correct CSS syntax with a selector (p) and property-value pair (font-weight:bold). Options B and D incorrectly use inline style syntax with font-size or text-size, which are not properties for bold text. Option C uses the non-existent property text-size.
B
Correct answer
Explanation
CSS is not limited to HTML - it can style XML documents, SVG graphics, and other markup languages. The statement claims CSS can only style HTML webpages, which is false. CSS is a general-purpose styling language.
-
display
-
view
-
visibility
-
z-index
A,C
Correct answer
Explanation
Two main CSS properties can hide elements: display:none removes the element completely from the layout, while visibility:hidden hides it visually but maintains its space in the layout. Options A and C are both correct. The 'view' property doesn't exist, and z-index only controls stacking order.
-
display
-
position
-
z-index
-
depth
C
Correct answer
Explanation
The CSS z-index property determines the stack order of elements that overlap. Elements with a larger z-index cover those with a smaller z-index. The display and position properties control layout and placement, while depth is not a valid CSS property.
-
<&>...</&>
-
<?php>...</?>
-
<?php…?>
-
<script>...</script>
C
Correct answer
Explanation
PHP scripts must be enclosed in delimiters. Option B incorrectly uses as the opening tag, while option A is not valid PHP syntax. The correct opening tag is as the closing tag.
-
printf("Hello World")
-
echo "Hello World";
-
"Hello World";
-
Document.write("Hello World");
B
Correct answer
Explanation
echo is the correct way to output text in PHP. While printf also works for formatted output, echo is the standard method for simple string output and is the most commonly used. Option C is just a string literal without an output command, and option D uses JavaScript syntax.
-
JavaScript
-
Multiplatform Compatible Script
-
Web Application security vulnerability to inject client side scripting into web pages viewed in other user sessions
-
Extended Secure Scripting
C
Correct answer
Explanation
Cross-Site Scripting (XSS) is a security vulnerability where attackers inject malicious client-side scripts (typically JavaScript) into web pages viewed by other users. This occurs when a web application accepts and displays user input without proper sanitization, allowing scripts to execute in victims' browsers. Option A 'JavaScript' is merely the language used, not the vulnerability itself. Options B and D are fabricated meanings unrelated to actual security terminology.