• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

HTML and XML

Question 1

Which of the following is an advantage of putting presentation information in a separate CSS file rather than in HTML itself?
  • The content becomes easy to manage
  • Becomes easy to make site for different devices like mobile by making separate CSS files
  • CSS Files are generally cached and therefore decrease server load and network traffic.
  • All of the above

Question 2

HTML(Hypertext Markup Language) has language elements which permit certain actions other than describing the structure of the web document. Which one of the following actions is NOT supported by pure HTML (without any server or client side scripting)pages?
  • Embed web objects from different sites into the same page
  • Refresh the page automatically after a specified interval
  • Automatically redirect to another page upon download
  • Display the client time as part of the page

Question 3

Consider the HTML t able definition given below:
< table border=1> <tr> <td rowspan=2> ab </td> <td colspan=2> cd </td> </tr> <tr> <td> ef </td> <td rowspan=2> gh </td> </tr> <tr> <td colspan=2> ik </td> </tr> </table>
The number of rows in each column and the number of columns in each row are:
  • (2, 2, 3) and (2, 3, 2)
  • (2, 2, 3) and (2, 2, 3)
  • (2, 3, 2) and (2, 3, 2)
  • (2, 3, 2) and (2, 2, 3)

Question 4

Which of following statements is/are False?
1. XML overcomes the limitations in HTML 
   to support a structured way of organizing content.

2. XML specification is not case sensitive while 
   HTML specification is case sensitive.

3. XML supports user defined tags while HTML
   uses pre-defined tags.

4. XML tags need not be closed while HTML 
   tags must be closed.
  • 2 only
  • 1 only
  • 2 and 4 only
  • 3 and 4 only

Question 5

In a web server, ten WebPages are stored with the URLs of the form http://www.yourname.com/var.html; where, var is a different number from 1 to 10 for each Webpage. Suppose, the client stores the Webpage with var = 1 (say W1) in local machine, edits and then tests. Rest of the WebPages remains on the web server. W1 contains several relative URLs of the form “var.html” referring to the other WebPages. Which one of the following statements needs to be added in W1, so that all the relative URLs in W1 refer to the appropriate WebPages on the web server?
  • <a.href: “http://www.yourname.com/”, href: “...var.html”>
  • <base href: “http://www.yourname.com/”>
  • <a.href: “http://www.yourname.com/”>
  • <base href: “http://www.yourname.com/”, range: “...var.html”>

Question 6

Consider an XML file called intro.xml and a document type definition (DTD) file intro.dtd as follows:

intro.xml

<?xml version = "1.0"?>

<!DOCTYPE myMessage SYSTEM "intro.dtd"›

<myMessage>

<message>Welcome to XML</message>

</myMessage>

intro.dtd

<! ELEMENT myMessage (message)>

<! ELEMENT message (#PCDATA)>

A validating parser will classify intro.xml as

  • Well-formed and validated

  • Well-formed but not validated

  • Validated but not well-formed

Question 7

Given below are several usages of the anchor tag in HTML.
  1. <A HREF = "http://www.gate.ac.in/HTML/BASIC/testpage.html">Test Me</A>
  2. <A HREF = "/BASIC/testpage.html">Test Me</A>
  3. <A HREF = "testpage.html">Test Me</A>
  4. <A HREF = "testpage.html#test">Test Me</A>
Which of the above are valid?
  • I and II only
  • I and III only
  • I, II and III only
  • I, II, III and IV

Question 8

Consider the three commands : PROMPT, HEAD and RCPT. Which of the following options indicate a correct association of these commands with protocols where these are used?  
  • HTTP, SMTP, FTP
  • FTP, HTTP, SMTP
  • HTTP, FTP, SMTP
  • SMTP, HTTP, FTP

Question 9

A HTML form is to be designed to enable purchase of office stationery. Required items are to be selected (checked). Credit card details are to be entered and then the submit button is to be pressed. Which one of the following options would be appropriate for sending the data to the server. Assume that security is handled in a way that is transparent to the form design.  

  • Only GET

  • Only POST

  • Either of GET or POST

  • Neither GET nor POST

Question 10

Given below is an excerpt of an xml specification.
<Book>
<title> GATE 2005 </title>
<type value = "BROCHURE"/>
<accno>10237623786</accno>
</Book>
<Book>
<type value = "FICTION"/>
<accno>0024154807</accno>
</Book>
Given below are several possible excerpts from "library.dtd". For which excerpt would the above specification be valid?
  • <!ELEMENT Book (title+, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type EMPTY> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>
  • <!ELEMENT Book (title?, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ATTLIST accno value (#PCDATA)>
  • <!ELEMENT Book (title*, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>
  • <!ELEMENT Book (title?, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type EMPTY> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>

There are 33 questions to complete.

Last Updated :
Take a part in the ongoing discussion