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

Multiple choice technology programming languages
  1. It describes the tags in existing languages

  2. It defines new markup languages

  3. It parses the code in existing markup languages

  4. All

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Programming events

  2. Text appearance

  3. Relationships between data

  4. Text structure

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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).

Multiple choice technology web technology
  1. eXtra Style Language

  2. eXpandable Style Language

  3. eXtensible Style Listing

  4. eXtensible Stylesheet Language

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. XML uses a description node to describe data

  2. XML uses a DTD to describe the data

  3. XML uses XSL to describe data

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. <first name>

  2. <NAME>

  3. <age>

  4. All 3 names are incorrect

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. <?xml version="1.0" />

  2. <xml version="1.0" />

  3. <?xml version="1.0"?>

  4. None of the above

Reveal answer Fill a bubble to check yourself
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 ?.

Multiple choice technology web technology
  1. All XML elements must be properly closed

  2. All the statements are true

  3. All XML elements must be lower case

  4. All XML documents must have a DTD

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. <CDATA> Text to be ignored </CDATA>

  2. <PCDATA> Text to be ignored </PCDATA>

  3. <xml:CDATA[ Text to be ignored ]>

  4. <![CDATA[ Text to be ignored ]]>

Reveal answer Fill a bubble to check yourself
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.