Computer Knowledge
Markup and Web Languages
1,492 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
-
Create a template of the XML hierachy
-
Validate the XML
-
Ensures Well Formed XML’s creation
-
Format the XML
A,B,C
Correct answer
Explanation
DTD (Document Type Definition) serves three key purposes in XML: it provides a template defining the valid structure and hierarchy of an XML document (Option A), validates that XML documents conform to that structure (Option B), and by defining the structure, it ensures the creation of well-formed XML documents (Option C). However, DTD is NOT used for formatting or presentation - that's the role of XSLT stylesheets. Therefore, Options A, B, and C are correct, while D is incorrect.
-
The ones which replacecs DTD’s
-
Helps in creating wellformed XML
-
Enforces Data Types in XML
-
Can be inline or external
B,C,D
Correct answer
Explanation
XSD (XML Schema Definition) provides enhanced capabilities for XML documents. It helps create wellformed XML by defining structure and constraints (Option B), enforces data types on elements and attributes (Option C), and can be embedded within XML documents or stored as external references (Option D). Option A is incorrect: XSD doesn't replace DTD - both coexist as schema definition languages, though XSD offers more powerful features like data typing and namespace support.
-
<Name>
-
<Element>
-
<Underscore>
-
<0~id>
D
Correct answer
Explanation
XML tag names must follow strict naming rules: they can contain letters, digits, and certain punctuation, but CANNOT start with a digit or punctuation character. '<0~id>' violates this rule because it starts with '0', making it invalid. Options A, B, and C are all valid XML tag names. CDATA sections allow including special characters as content but don't affect tag naming rules.
-
XML Enforces Strict Type Checking
-
XML are strictly non-extendable
-
XML replaces the old HTML
-
XML extends HTML
A
Correct answer
Explanation
Option A is correct: when used with XSD schemas, XML enforces strict data type checking on elements and attributes, which is one of XML's key advantages over looser formats. Option B is incorrect because XML was designed specifically to be extensible - developers can create custom tags and structures. Option C is incorrect because XML doesn't replace HTML; they serve different purposes (data vs. presentation). Option D is incorrect because XML doesn't extend HTML - XHTML does, but plain XML and HTML are separate specifications.
D
Correct answer
Explanation
XML (eXtensible Markup Language) was designed as a simplified, streamlined subset of SGML (Standard Generalized Markup Language). SGML is a complex, full-featured meta-language for defining markup languages, while XML保留了 SGML's core capabilities but removed its complexity to make it practical for web use. Option D is correct. HTML, WSDL, and JSP are not the parent language of XML - HTML is a separate markup language, WSDL is an XML-based interface definition language, and JSP is a server-side Java technology.
-
All the statements are true
-
All XML elements must have a closing tag
-
All XML elements must be lower case
-
All XML documents must have a DTD
B
Correct answer
Explanation
In XML syntax, every start-tag must have a corresponding end-tag (closing tag), making this statement true. XML elements do not have to be lowercase, and XML documents do not require a DTD to be well-formed.
-
It contains a root element
-
It contain an element
-
It contains one or more elements
-
Must contain one or more elements and root element must contain all other elements
-
The browser name
-
The size of element name
-
Entity declarations
-
Element declarations
A
Correct answer
Explanation
DTD specifies element declarations, entity declarations, attribute list declarations (ATTLIST), and notation declarations. It is browser-independent and does NOT specify which browser to use. The DTD defines document structure, not presentation or browser-specific information.
-
Required when validating XML documents
-
No longer necessary after the XML editor has been customized
-
Used to direct conversion using an XSLT processor
-
A good guide to populating a templates to be filled in when generating an XML document automatically
A
Correct answer
Explanation
DTD is required for validating XML documents against a defined structure. XSLT uses XSLT stylesheets for transformation, not DTD. Customizing an XML editor doesn't eliminate the need for DTD when validation is required. DTD defines structure, not template content.
-
In XMl Declaration
-
As an Attribute of Root Element
-
In the ATTLIST
-
In DTD
D
Correct answer
Explanation
Processing Instructions (PIs) like can be included in the DTD section of an XML document. They provide instructions to applications processing the XML. PIs are not attributes, not part of element declarations, and not restricted to the XML declaration alone.
-
Complex Content
-
Simpel Content
-
Hybrid Content
-
Pre-Defined Content
A
Correct answer
Explanation
In XSD, an empty element has complex type with complexContent restriction. It may have attributes but no character content. Simple content would allow text content. 'Simpel' is also misspelled. Empty elements like
have complex content models in schema definitions.
-
Are a part of XML Structure
-
Are mandatory in XSD
-
Are Used in Inline and External XSD
-
None of the above
C
Correct answer
Explanation
XSD annotations () provide documentation and are optional. They can appear in both inline XSD (embedded in XML) and external XSD files. Annotations are not part of core XML structure - they're XSD-specific documentation elements.
-
All the statements are true
-
All XML elements must have a closing tag
-
All XML elements must be lower case
-
All XML documents must have a DTD
B
Correct answer
Explanation
XML requires all elements to have a closing tag (or self-close like
). XML is case-sensitive but doesn't require lowercase. DTD is optional for XML - well-formed XML doesn't need a DTD. Only option B is universally true for XML.
-
Improves Server Performance
-
Allows customize data presentations
-
Replaces XML
-
Used to store xml to databases
B
Correct answer
Explanation
XSLT transforms XML documents into different formats like HTML, text, or other XML - enabling customized presentations. It doesn't replace XML, doesn't inherently improve server performance, and isn't for database storage. XSLT is a presentation layer technology.
-
<xml version="1.0" />
-
<?xml version="1.0"?>
-
<?xml version="1.0" />
-
None of the above
C
Correct answer
Explanation
XML declaration uses Processing Instruction syntax: . Option A is wrong - needs not <. Option B is technically correct but marked false. Option C adds a space before ?> which is also valid XML 1.0 syntax. The ?> PI syntax is the key.