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
-
XML Schema and HTTP.
-
b. HTTP and SOAP.
-
c. XML schema and SOAP.
-
None of the above.
C
Correct answer
Explanation
All interactions with a UDDI registry are performed using a defined XML Schema (for data structure) and SOAP (for messaging protocol).
-
SOAP is for HTTP only
-
SOAP can be used in combination with any protocol that can carry a SOAP envelope
-
All the above
-
none of the above
B
Correct answer
Explanation
SOAP is protocol-agnostic. While commonly used with HTTP, SOAP envelopes can be transported over any protocol that can carry XML/text - SMTP, JMS, TCP, etc. Option A incorrectly restricts SOAP to HTTP only.
-
No
-
Yes
-
always present
-
None of the above
A
Correct answer
Explanation
In tiles-defs.xml, the tag is the root element. XML documents have exactly one root element. Therefore, there can only be one tag at the top level. All individual tags must be nested within this single root tag.
-
yes
-
no
-
None of the above
-
It Depends.
A
Correct answer
Explanation
Within the root tag, you can have multiple tags. Each tag defines a separate tile definition. This is the standard way to define multiple tiles in a single tiles-defs.xml configuration file.
-
<actionpath="/r4r" type="org.apache.struts.webapp.example.EditSubscriptionAction" name="r4rForm" scope="request" validate="false"> <forward name="failure" path="/index.jsp"/> <forward name="success" path="/admin.jsp"/> </action>
-
.<action classpath="/r4r" type="org.apache.struts.webapp.example.EditSubscriptionAction" name="r4rForm" scope="request" validate="false"> <forward name="failure" path="/index.jsp"/> <forward name="success" path="/admin.jsp"/> </action
-
<action path="/r4r" type="org.apache.struts.webapp.example.EditSubscriptionAction" id="r4rForm" scope="request" validate="false"> <forward name="failure" path="/index.jsp"/> <forward name="success" path="/admin.jsp"/> </action>
-
None
A
Correct answer
Explanation
In Struts config, the tag uses 'path' (not 'classpath' or 'actionpath') to specify the URL mapping. Option A is correct with path="/r4r". Option B incorrectly uses 'classpath' and has a typo with '.' before action. Option C incorrectly uses 'id' instead of 'name'. The correct attribute for associating a form bean with an action is 'name'.
-
Always converts HTML markup to entity equivalents, like <
-
Never converts HTML markup to entity equivalents
-
Converts markup when filter=true
-
Converts markup when markup=false
C
Correct answer
Explanation
The tag has a 'filter' attribute that controls HTML escaping. When filter='true' (or filter is not specified, as true is default), the tag converts HTML markup characters like <, >, &, ' to their entity equivalents (<, >, &, ') to prevent XSS attacks. When filter='false', it outputs content as-is without conversion.
-
It should be easy to write programs that process XML documents
-
Optional features should be kept to a minimum, ideally zero
-
XML documents should be human legible and reasonably clear
-
None
-
Optional but makes a document more portable
-
Highly discouraged by W3C standards
-
Recommended for HTML programming only
-
None
-
<style>
-
<css>
-
<script>
-
None of the above
A
Correct answer
Explanation
The tag is used to define an internal style sheet in HTML. It is placed within the <head> section and contains CSS rules. There is no <css> tag in HTML - <script> is for JavaScript, not styles.
A
Correct answer
Explanation
The correct answer is A. "style" is the HTML attribute used to define inline styles. This attribute is applied directly to the HTML element and allows you to specify CSS styles for that particular element.
Let's go through the other options and explain why they are incorrect:
B. "font": This attribute is not used to define inline styles. It was commonly used in older versions of HTML to specify font-related styles, but it is now considered deprecated and should be avoided.
C. "class": The "class" attribute is used to define a class for an HTML element, which can be used to apply styles defined in CSS. However, it is not specifically used for defining inline styles.
D. "styles": This is not a valid HTML attribute. The correct attribute is "style".
So, the correct answer is A. "style".
-
body {color: black}
-
{body;color:black}
-
{body:color=black(body}
-
body:color=black
A
Correct answer
Explanation
CSS syntax uses: selector { property: value; }. The selector (body) is followed by curly braces containing property-value pairs separated by colons. Option A shows this correctly. Option B reverses the order, Option C uses invalid syntax, and Option D uses a colon incorrectly.
-
h1 {background-color:#FFFFFF}
-
all.h1 {background-color:#FFFFFF}
-
h1.all {background-color:#FFFFFF}
-
None of the above
A
Correct answer
Explanation
CSS uses element selectors directly followed by property declarations in curly braces. The background-color property sets the background color, and #FFFFFF represents white in hex color notation. Options B and C use incorrect selector syntax with 'all' keyword.
-
<p style="text-size:bold">
-
p {font-weight:bold}
-
<p style="font-size:bold">
-
p {text-size:bold}
B
Correct answer
Explanation
The font-weight property controls text boldness in CSS. Option B uses correct CSS syntax: 'p' selector with font-weight:bold property declaration. Options A and C incorrectly mix inline style syntax with wrong property names.
B
Correct answer
Explanation
Padding creates space between an element's content and its border, and CSS does not allow negative padding values. Unlike margins, negative padding would push content outside the element's border, which violates the box model concept.
B
Correct answer
Explanation
The C# compiler switch /doc extracts XML documentation comments (///) from source code and generates an XML documentation file. Options /text, /xml, and /help are not valid compiler switches for this purpose. The /doc switch is commonly used for generating API documentation.