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
B
Correct answer
Explanation
XML documents do NOT require an associated DTD or schema. While DTDs and schemas can be used to define document structure and validate content, they are optional. Many XML documents are well-formed without any schema definition. The requirement is for well-formedness, not validity.
A
Correct answer
Explanation
XML preserves whitespace in element content by default, unlike HTML which collapses multiple spaces. This means spaces, tabs, and newlines within elements are maintained as part of the document's character data. The xml:space attribute can further control whitespace handling in specific elements.
-
<![CDATA[ Text to be ignored ]]>
-
<xml:CDATA[ Text to be ignored ]>
-
<PCDATA> Text to be ignored </PCDATA>
-
<CDATA> Text to be ignored </CDATA>
A
Correct answer
Explanation
CDATA (Character Data) sections use the syntax `to tell the XML parser to treat the enclosed content as literal text, ignoring any special characters like<,>, or&that would normally be interpreted as markup. The other options either use incorrect prefixes (xml:), wrong element names (PCDATA), or missing the required![` sequence.
-
<stylesheet type="text/xsl" href="style.xsl" />
-
<link type="text/xsl" href="style.xsl" />
-
<?xml-stylesheet type="text/xsl" href="style.xsl" ?>
C
Correct answer
Explanation
Stylesheets are referenced using the processing instruction with attributes for `type` and `href`. Options A and B use incorrect element-based syntax ( and ``) which are not valid for associating XSL stylesheets with XML documents. The processing instruction must appear in the XML prolog.
-
<first name>
-
<age>
-
<NAME>
A
Correct answer
Explanation
XML element names cannot contain spaces. The name is invalid because it contains a space character. Element names must start with a letter or underscore, and can only contain letters, digits, hyphens, underscores, and periods. and `` are both valid names.
-
Not as much coding is needed
-
Its ability to adapt to new uses
-
The fact that its supported by all of the major software vendors
B
Correct answer
Explanation
XML's extensibility - the ability to define custom tags and document structures - makes it more powerful than HTML. While HTML has a fixed set of tags, XML allows users to create their own tag sets tailored to specific applications. This adaptability enables XML to be used for countless data representation purposes beyond web pages.
-
Create new tags
-
Exchange information over the Web
-
Put your tags in any order, with closing tags optional
A
Correct answer
Explanation
To solve this question, the user needs to have knowledge about XML and its features.
Now, let's go through each option and explain why it is right or wrong:
A. Create new tags: This option is correct. Unlike HTML, XML allows users to create their own custom tags. This flexibility allows for more specific and structured data representation.
B. Exchange information over the Web: This option is incorrect. While XML is often used for exchanging information over the web, it is not the only purpose of XML. XML can be used for various purposes, including data storage and representation.
C. Put your tags in any order, with closing tags optional: This option is incorrect. In XML, tags must be properly nested, and closing tags are mandatory. The order of tags is also important in XML, as it defines the structure and hierarchy of the data.
The Answer is: A
C
Correct answer
Explanation
The W3C published the first working draft of the XML specification in 1996 (specifically November 1996). XML was designed to improve upon SGML and HTML by providing a more flexible markup language for the web. 1994-1995 were too early, and 1997 was when XML 1.0 became a recommendation.
-
Internet Engineering Task Force (IETF)
-
IEEE
-
American National Standards Institute (ANSI)
-
OASIS
C
Correct answer
Explanation
ANSI published SGML as a standard in 1980. SGML was the precursor to both HTML and XML, providing a framework for defining markup languages. The IETF handles internet protocols, IEEE focuses on engineering standards, and OASIS deals with e-business standards.
-
Apply the style to a specific element
-
Apply the style to all the elements
-
Apply the style to a group of elements
-
Apply the style to elements of the same type
A
Correct answer
Explanation
In CSS, an ID selector (e.g., #header) is used to target a single, unique element on a page. Class selectors are used for groups of elements, and element selectors (tags) are used for all elements of a specific type. IDs have higher specificity than classes.
-
Tag
-
Attribute
-
Deceleration
-
This is H1
-
h1 {color: red;}
C
Correct answer
Explanation
A CSS declaration consists of a property and its associated value. The correct term is 'Declaration' but option C uses 'Deceleration' which appears to be a typo/spelling error. However, this is clearly the intended answer. Option A 'Tag' refers to HTML elements. Option B 'Attribute' refers to HTML name-value pairs. Option E shows a complete CSS rule, not a single declaration. Option D is nonsensical filler.
-
<scripting>
-
<javascript>
-
<js>
-
<script>
D
Correct answer
Explanation
The standard HTML tag for embedding or referencing executable script (usually JavaScript) is `. Tags like<scripting>or<js>` are not valid HTML elements.
-
Asynchronous JavaScript and XML
-
Asynchronous JavaScript and XtraLanguage
-
Asyns JavaScript and HTML
-
Added JavaScript and XML
A
Correct answer
Explanation
AJAX stands for Asynchronous JavaScript and XML, a technique for creating interactive web applications. Option A is correct. Options B XtraLanguage, C HTML instead of XML, and D Added instead of Asynchronous are incorrect.
-
Web Services Description Language
-
Web Services Defination Language
-
Web Server Description Language
-
Web Server Defination Language
A
Correct answer
Explanation
WSDL stands for Web Services Description Language, an XML-based language for describing web services. Option A is correct. Options B, C, and D use incorrect terms Defination typo and Server instead of Services.
-
eXtra Hypertext Markup Language
-
eXtensible Hypertension Markup Language
-
eXtra Hypertext Makeup Language
-
eXtensible Hypertext Markup Language
D
Correct answer
Explanation
XHTML stands for eXtensible Hypertext Markup Language, a reformulation of HTML 4 as an XML application. Option D correctly identifies 'eXtensible' (not eXtra), 'Hypertext' (not Hypertension), and 'Markup' (not Makeup).