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

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.

Multiple choice technology web technology
  1. X-Markup Language

  2. eXtensible Markup Language

  3. Example Markup Language

  4. eXtra Modern Link

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

XML stands for eXtensible Markup Language. The 'X' represents 'eXtensible', reflecting that XML allows users to define their own tags and document structure, unlike HTML which has fixed tags.

Multiple choice technology web technology
  1. <link type="text/xsl" href="mystyle.xsl" />

  2. <?xml-stylesheet type="text/xsl" href="mystyle.xsl" ?>

  3. <stylesheet type="text/xsl" href="mystyle.xsl" />

  4. None of the above

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

The correct way to reference an XSL stylesheet in XML is using the xml-stylesheet processing instruction: . This is placed in the XML prolog, not as an HTML-style link tag.

Multiple choice technology web technology
  1. Web Services Data Language

  2. Web Services Describing Language

  3. Web Services Description Language

  4. None of these

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

WSDL stands for Web Services Description Language. It is an XML-based language for describing web services, including their location, operations, and message formats. Option C has the correct expansion.

Multiple choice technology web technology
  1. 2

  2. 3

  3. 4

  4. 1

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

In WSDL (Web Services Description Language), the `element has exactly two attributes:nameandtype. Thenameattribute provides a unique identifier for the binding, while thetype` attribute references the port type being bound, making "2" the correct answer.

Multiple choice technology web technology
  1. style attribute

  2. both 1 and 3

  3. transport attribute

  4. message attribute

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

To answer this question, the user needs to know about the SOAP protocol and its binding element.

The SOAP protocol is an XML-based messaging protocol used to exchange information between different systems. The soap:binding element is used to define the binding of a web service operation to a particular communication protocol.

The soap:binding element has two attributes:

A. style attribute: This attribute is used to define the encoding style used for the message. It specifies whether the message is encoded using the SOAP encoding rules or some other encoding rules.

B. transport attribute: This attribute is used to specify the communication protocol used for the message. It specifies the transport protocol used for sending and receiving the SOAP message. The transport protocol can be HTTP, SMTP, or any other protocol.

C. message attribute: This attribute is not a valid attribute for the soap:binding element. The message attribute is used in the soap:operation element to specify the input and output messages for the operation.

Therefore, the correct answer is:

B. Both 1 and 3