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
-
sequence
-
regular expression
-
XSD
-
XLT
B
Correct answer
Explanation
Regular expressions (specified using xs:pattern in XSD) are used to define complex restrictions on element content. They allow you to specify precise patterns that values must match, such as specific formats, character combinations, or structural requirements.
-
xs:value
-
xs:sequence
-
xs:enumeration tag
-
None
C
Correct answer
Explanation
The xs:enumeration facet is used to define a specific list of valid values for an attribute or element. It restricts the value to exactly one of the enumerated options, providing a controlled vocabulary.
B
Correct answer
Explanation
XML can be transformed into many output formats beyond HTML and XHTML using XSLT (Extensible Stylesheet Language Transformations). Common targets include plain text, PDF (via XSL-FO), other XML dialects, JSON, CSV, and custom formats.
-
Extract text from the result document
-
Extract text from the source document
-
Place text into the source document
-
None of the above
B
Correct answer
Explanation
The xsl:value-of element extracts and outputs the text content from a node in the SOURCE XML document. It evaluates the XPath expression in the select attribute against the input document and inserts the result into the output tree.
-
Select the Jim element
-
Select the Jim attribute
-
Select the id attribute
-
Select the id attribute if the value is Jim
C
Correct answer
Explanation
The expression select="@id" (with value 'Jim' being the predicate filter) selects the id attribute value of elements where id equals 'Jim'. Option C correctly identifies that it selects the id attribute - the @ symbol in XPath denotes an attribute.
B
Correct answer
Explanation
The xsl:if element instructs the XSLT PROCESSOR to evaluate a test condition, not CSS. CSS is a styling language for HTML and has no relation to XSLT conditional processing logic.
A
Correct answer
Explanation
The SAX (Simple API for XML) parser is event-based and reads through the document sequentially from start to finish. Unlike DOM parsers, SAX cannot traverse back and forth or randomly access nodes - it processes in a single forward pass.
-
createElement()
-
reateTextNode()(
-
createComment()
-
None of the above
D
Correct answer
Explanation
The SAX parser is event-based and does not create node objects at all. Methods like createElement(), createTextNode(), and createComment() are DOM API methods. SAX fires events (startElement, characters, endElement) but doesn't build a node tree.
-
CDATA sections
-
Comments
-
Elements
-
1 & 3
-
All of the above
B
Correct answer
Explanation
Different computers can use different versions of DOM parsers without compatibility issues. DOM parsers are designed to work with standard DOM specifications, and version differences between machines are normal and acceptable in web development environments.
-
Organizes the XML document into a tree
-
Reads a block of an XML document at a time
-
Enables you to correct the contents of an XML document
-
None of the above
B
Correct answer
Explanation
SAX (Simple API for XML) is an event-based, streaming parser that reads XML documents sequentially in blocks. It doesn't build a tree structure like DOM parsers, and it's read-only - it cannot modify XML content. This makes it memory-efficient for large XML files.
-
Statements will continue to execute as the XML document is being loaded.
-
Statements will not execute until the XML document is being loaded.
-
The XML document is synchronized to the HTML page.
-
None of the above
B
Correct answer
Explanation
When async is set to false in XML loading (e.g., XMLHttpRequest), JavaScript execution blocks until the XML document is fully loaded. This creates synchronous behavior - the next statement won't execute until the load operation completes. This is the opposite of async=true, which allows continued execution during loading.
-
Property containing a reference to the first child of an element
-
Method that makes the current node the first child
-
Method that substitutes the first node for the last node
-
Method that substitutes the last node for the first node
A
Correct answer
Explanation
firstChild is a DOM property that contains a reference to the first child node of an element. It's a read-only property that returns null if the element has no children. It's not a method that performs actions - it simply accesses the existing node structure.
-
Create a new HTML element
-
Create a title for a new HTML element
-
Create a new XML element
-
Create an attribute called title for the current XML element
C
Correct answer
Explanation
createElement() is a DOM method used to create new element nodes. While it can create both HTML and XML elements, in the context of XML programming (which the other questions reference), option C is the intended answer. Option B is incorrect because it doesn't create titles - it creates elements. Option D is incorrect because it doesn't create attributes.
-
Internet Explorer 5.0
-
Netscape 7.1
-
Firefox 1.0
-
All of Above
D
Correct answer
Explanation
All listed browsers support AJAX through XMLHttpRequest. IE 5.0 introduced it, Netscape 7.1 and Firefox 1.0 both supported the core XMLHttpRequest API needed for asynchronous requests.