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
-
It describes the tags in existing languages
-
It defines new markup languages
-
It parses the code in existing markup languages
-
All
B
Correct answer
Explanation
A metamarkup language defines new markup languages. XML is the classic example - it's used to define other markup languages like XHTML, SVG, or custom XML applications. It doesn't describe or parse existing languages but provides the framework for creating new ones.
-
Programming events
-
Text appearance
-
Relationships between data
-
Text structure
B,D
Correct answer
Explanation
Markup languages like HTML or XML define document structure and formatting. Text appearance (B) is controlled through styling tags and attributes, while text structure (D) is defined through hierarchical element organization. Programming events and data relationships are handled by programming languages, not markup languages.
B
Correct answer
Explanation
XML was designed to complement HTML, not replace it. HTML defines the structure and presentation of web pages, while XML provides a flexible, extensible way to structure and describe data. They serve different purposes: HTML is for displaying information, XML is for storing and transporting structured data. The two technologies can work together (e.g., XHTML).
-
eXtra Style Language
-
eXpandable Style Language
-
eXtensible Style Listing
-
eXtensible Stylesheet Language
D
Correct answer
Explanation
XSL stands for eXtensible Stylesheet Language, a family of languages used to transform and render XML documents. It includes XSLT (for transformations), XSL-FO (for formatting), and XPath (for navigating XML documents). XSL defines how XML data should be displayed or converted to other formats.
-
XML uses a description node to describe data
-
XML uses a DTD to describe the data
-
XML uses XSL to describe data
-
None of the above
B
Correct answer
Explanation
A Document Type Definition (DTD) is a traditional way to describe the structure, elements, and attributes of an XML document. While XSL is used for styling and transforming XML data, it does not describe the data structure itself. Description nodes do not exist in standard XML.
B
Correct answer
Explanation
This XML document is NOT well-formed because the attribute value 'age=29' is not enclosed in quotes. XML requires all attribute values to be quoted (either single or double quotes). The correct syntax would be or . Well-formedness is a strict requirement - any violation of XML syntax rules makes the document invalid.
-
<first name>
-
<NAME>
-
<age>
-
All 3 names are incorrect
A
Correct answer
Explanation
XML element names cannot contain spaces. '' is invalid because the element name has a space between 'first' and 'name'. Valid XML names can contain letters, digits, hyphens, underscores, and periods, but not spaces. The other options ( and ) are valid element names.
-
<?xml version="1.0" />
-
<xml version="1.0" />
-
<?xml version="1.0"?>
-
None of the above
C
Correct answer
Explanation
The correct XML version declaration is . Note that it uses a question mark at both the beginning and end, and it ends with ?> not />. This is a processing instruction (PI), not an element, so it doesn't follow XML element syntax. Option A incorrectly uses /> (element closing syntax), and option B omits the opening ?.
-
All XML elements must be properly closed
-
All the statements are true
-
All XML elements must be lower case
-
All XML documents must have a DTD
A
Correct answer
Explanation
All XML elements must be properly closed, either with a separate closing tag (like ) or as an empty element using self-closing syntax (like ). This is a fundamental requirement for well-formed XML documents. Option C is false because XML is case-sensitive but case can be mixed. Option D is false because DTD is optional - XML can exist without a DTD.
B
Correct answer
Explanation
XML does NOT preserve whitespace. By default, XML processors normalize whitespace in element content (converting multiple spaces to a single space and trimming leading/trailing spaces). Whitespace in attributes is preserved. To preserve whitespace in elements, you must use the xml:space attribute with value 'preserve'. This behavior is different from HTML, where whitespace is typically preserved in display.
B
Correct answer
Explanation
XML elements CAN be empty - they can be written as or self-closing . This is valid XML syntax and commonly used for elements that don't need content. The statement incorrectly claims empty elements are impossible.
B
Correct answer
Explanation
XML attribute values MUST be enclosed in quotes - either double quotes (") or single quotes ('). This is a fundamental XML syntax rule. For example, is valid but is not.
-
<CDATA> Text to be ignored </CDATA>
-
<PCDATA> Text to be ignored </PCDATA>
-
<xml:CDATA[ Text to be ignored ]>
-
<![CDATA[ Text to be ignored ]]>
D
Correct answer
Explanation
The correct syntax for XML parser to ignore content is . This tells the parser to treat the content as character data rather than markup. CDATA sections are used for text that might contain special characters like < or & that should not be interpreted as XML.