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 xhtml
  1. <p>A short paragraph</p>

  2. <p>A short paragraph</p>

  3. <p>A short paragraph</P>

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In XHTML, tags must be properly nested - inner tags must close before outer tags close. Option A has closing after , which violates nesting. Option C uses which mixes case (XHTML is case-sensitive, lowercase required). Option B shows correct nesting: opens, then opens, then closes, then closes.

Multiple choice xhtml
  1. Strict, Transitional, Loose, Frameset

  2. Strict, Transitional, Frameset

  3. Strict, Transitional, Loose

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

XHTML 1.0 defines three Document Type Definitions (DTDs): Strict (no deprecated elements), Transitional (allows deprecated elements for compatibility), and Frameset (for documents with frames). 'Loose' is not a valid DTD type in XHTML.

Multiple choice xhtml
  1. Loose

  2. Normal

  3. Transitional

  4. Frameset

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The Transitional DTD is the most commonly used because it supports deprecated HTML elements and attributes while still enforcing XHTML's stricter syntax rules. This provides a migration path from HTML to XHTML without requiring immediate cleanup of legacy markup.

Multiple choice xhtml
  1. Yes

  2. No

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Yes - all XHTML documents must include a DOCTYPE declaration to be valid. The DOCTYPE tells the validator and browser which DTD to use for validation and rendering. Without it, the document is not valid XHTML.

Multiple choice xhtml
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

XHTML is case-sensitive and requires all element and attribute names to be in lowercase. This is different from HTML, which is case-insensitive. Writing

or

would make an XHTML document invalid.

Multiple choice xml
  1. eXtensible Markup Language

  2. X-Markup Language

  3. Example Markup Language

  4. eXtra Modern Link

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

XML stands for eXtensible Markup Language. The 'extensible' means you can define your own custom tags and elements, unlike HTML which has a predefined set of tags. This flexibility is why XML became foundational for many technologies including XHTML, RSS, and more.

Multiple choice xml
  1. 1-2-4_6

  2. :3:-3:5:-7

  3. ;123456

  4. 3:4;-7

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

XML names have strict rules: must start with a letter or underscore, can contain letters, digits, hyphens, underscores, and periods. Option A starts with a number (invalid). Option C starts with semicolon (invalid). Option D contains semicolon and dash after colon. Option B (:3:-3:5:-7) starts with a colon, which is technically allowed as it represents a namespace prefix - though unusual without a namespace declaration, it follows XML name rules.

Multiple choice xml
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The statement is false. DOM Level 2 DOES provide mechanisms for working with namespaces - it introduced namespace-aware methods like getElementsByTagNameNS(), getAttributeNS(), and has attributes like namespaceURI, prefix, and localName on nodes. These allow DOM code to interrogate and modify namespace information in XML documents.

Multiple choice xml
  1. DOMString, UTF-8

  2. DOMString, Unicode

  3. UNICODEString, Unicode

  4. String, Unicode

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The Document Object Model (DOM) defines the 'DOMString' type for handling text. According to the W3C specification, these strings are sequences of 16-bit units using the Unicode encoding scheme, allowing for international character support.

Multiple choice xml
  1. DOM

  2. SAX

  3. CSS

  4. XSL

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

DOM (Document Object Model) loads the entire XML document into memory as a tree structure, allowing bidirectional navigation, search, and modification of elements. This makes it ideal for scenarios requiring user interaction like searching and editing. SAX is event-based, read-only, and processes the document sequentially without preserving the document structure in memory, making it unsuitable for editing operations.

Multiple choice xml
  1. Elements may nest but not overlap

  2. Quoting attributes is optional

  3. Elements may have multiple attributes with the same name

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In XML, elements must be properly nested, meaning a child element must be closed before its parent element is closed; they cannot overlap. Unlike HTML, quoting attributes is mandatory in XML, and elements cannot have multiple attributes with the same name.

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

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

  3. <xml version="1.0" />

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

XML declarations are processing instructions that must start with and end with `?&gt;`. The correct syntax is where the xml keyword is followed by the version attribute. Option A incorrectly closes with /&gt; (processing instructions don't use self-closing tags), and Option C uses element tags `` instead of processing instruction syntax.

Multiple choice xml
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Every XML document must be well-formed, which means it must follow XML syntax rules: proper nesting of elements, correct attribute quoting, single root element, and proper closing of all tags. This is a fundamental requirement for any document to be processed by an XML parser.