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
-
An XML element that contains other XML elements
-
An XML element that contains parsed character data
-
An XML element thats used to define data for use only on a PC
-
None of the above
B
Correct answer
Explanation
PCDATA stands for Parsed Character Data - it's text content that will be parsed by the XML parser (unlike CDATA which is not parsed). PCDATA is the default content type for elements containing text and child elements.
B
Correct answer
Explanation
The statement is false. While parsers are commonly used to read XML documents, they're not strictly required - XML can be read as plain text. However, parsers are necessary to properly parse, validate, and process the XML structure.
B
Correct answer
Explanation
The statement is false. XML uses flexible, variable-length text markup rather than fixed-length fields. This flexibility is a key advantage over traditional fixed-length database systems, allowing hierarchical and nested data structures.
-
HTML
-
SGML
-
MGL
-
None of the above
B
Correct answer
Explanation
XML is indeed a subset of SGML (Standard Generalized Markup Language), developed as a simpler, more streamlined version. HTML is also an SGML application, not the parent of XML. 'MGL' is not a standard markup language.
B
Correct answer
Explanation
In XML and DTD, parent elements can absolutely contain other parent elements through nesting. For example, a element can contain multiple elements, and those chapters can contain elements. The statement claims the opposite, making it false.
-
Create the CDATA section of an XML document
-
Create an XML document
-
Identify the parser that is used to parse the XML document
-
Identify the DTD for an XML document
D
Correct answer
Explanation
The DOCTYPE declaration appears at the beginning of an XML document and specifies which DTD (Document Type Definition) should be used to validate the document's structure. It links the XML document to its governing schema.
-
CDATA
-
An attribute
-
A UNICODE value
-
A comment
C
Correct answer
Explanation
Special symbols in XML can be inserted using Unicode values like © for copyright symbol © or € for € (ampersand-hash-number-semicolon). CDATA is for unparsed blocks, not for inserting individual special characters.
B
Correct answer
Explanation
A DTD declares all possible elements that MAY appear in an XML document, but it doesn't require that every declared element must actually be used in every instance. An XML document only needs to contain the elements it actually uses.
-
The child element is required.
-
The name of the child element is unknown.
-
One occurrence of the child element is required.
-
The child element is optional
D
Correct answer
Explanation
In DTD element declarations, a question mark (?) following a child element name means that element is optional (zero or one occurrence). For example, means title is optional while author is required.
A
Correct answer
Explanation
In XML (and HTML), empty elements are those that don't have separate opening and closing tags and don't contain content. The
tag is the classic example - it's self-closing and contains no child content, only attributes.
-
XML Schema
-
DTD
-
PCDATA
-
XSD
A
Correct answer
Explanation
XML Schema (XSD - XML Schema Definition) is the W3C standard for defining complex types in XML. It provides much richer type definitions than DTD, including data types, inheritance, and complex element structures. Note: XSD IS XML Schema, but A is the more specific answer about the concept.
-
Identify ownership of the XML schema
-
Identify ownership of the XML document
-
Identify that this is an XML schema
-
Identify the XML schema specifications used in the XML schema
D
Correct answer
Explanation
The namespace declaration xmlns:xs="http://www.w3.org/2001/XMLSchema" identifies that the document is using the official W3C XML Schema specifications. The 'xs' prefix becomes the namespace qualifier for all XML Schema elements (like xs:element, xs:complexType).
-
Specifies the sequence in which elements must appear in an XML schema
-
Specifies the sequence in which elements must appear in an XML document
-
Specifies the sequence in which attributes must appear in an XML document
-
Specifies the sequence in which attributes must appear in an XML schema
B
Correct answer
Explanation
The xs:sequence tag in XML Schema defines that child elements must appear in a specific order in the XML document instance. For example, xs:sequence containing xs:element name="first" then xs:element name="last" means the XML document must have first element before last element.
-
Identify the owner of the XML document
-
Identify the owner of the XML schema
-
Identify the location of the XML schema
-
Identify the location of the XML document
C
Correct answer
Explanation
The xsi:schemaLocation attribute is specifically designed to identify the location of an XML schema (XSD) that defines the structure for the XML document. It typically appears as xsi:schemaLocation="namespaceURI schemaLocation" where schemaLocation points to the actual schema file.