HTML and XML

Question 1
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?
Cross
Embed web objects from different sites into the same page
Cross
Refresh the page automatically after a specified interval
Cross
Automatically redirect to another page upon download
Tick
Display the client time as part of the page


Question 2
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:
Cross
(2, 2, 3) and (2, 3, 2)
Cross
(2, 2, 3) and (2, 2, 3)
Tick
(2, 3, 2) and (2, 3, 2)
Cross
(2, 3, 2) and (2, 2, 3)


Question 2-Explanation: 
cd ab ef ij gh ab -> rowspan \"2\" cd -> colspan \"2\" 1st row closed <tr> is row <td> is data ef placed in 2nd row. gh is in same row but rowspan \"2\" 2nd row also closed. Move to 3rd row. Insert ij . its colspan \"2\". More information: [1]www.w3schools.com [2]http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_td  
Question 3
Which of the following is an advantage of putting presentation information in a separate CSS file rather than in HTML itself?
Cross
The content becomes easy to manage
Cross
Becomes easy to make site for different devices like mobile by making separate CSS files
Cross
CSS Files are generally cached and therefore decrease server load and network traffic.
Tick
All of the above


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.
Cross
2 only
Cross
1 only
Tick
2 and 4 only
Cross
3 and 4 only


Question 4-Explanation: 
1.TRUE- XML is a structured way of 
         organizing content.
2.FALSE- XML is CASE SENSITIVE whereas 
          HTML is NOT case sensitive. 
3.TRUE- XML facilitates User Defined tags
        whereas HTML has only Pre-Defined
        tags 
4.FALSE- XML tags MUST be closed while HTML 
         tags may NOT be closed.
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?
Cross
<a.href: “http://www.yourname.com/”, href: “...var.html”>
Tick
<base href: “http://www.yourname.com/”>
Cross
<a.href: “http://www.yourname.com/”>
Cross
<base href: “http://www.yourname.com/”, range: “...var.html”>


Question 5-Explanation: 
The tag specifies the base URL/target for all relative URLs in a document. There can be at maximum one element in a document, and it must be inside the element. Source: http://www.w3schools.com/tags/tag_base.asp
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

Tick

Well-formed and validated

Cross

Well-formed but not validated

Cross

Validated but not well-formed



Question 6-Explanation: 

The difference between well-formed and valid XML is simple: Valid XML has a DTD associated with it and has been verified against all the rules contained in the DTD in addition to being well-formed. Merely well-formed XML, on the other hand, is not necessarily valid, although it may be. In order to know the rules for a well formed document click here

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?
Cross
I and II only
Cross
I and III only
Cross
I, II and III only
Tick
I, II, III and IV


Question 7-Explanation: 
I is valid because the link given in href tag is a valid link. 
The link given is an absolute url and hence holds correct.
II is valid because the link given in href tag is relative url. 
It redirects the user corresponding to the domain name of the current page. 
If you are on domain name of geeksforgeeks as http://www.geeksforgeeks.org/ 
then it will take you to http://www.geeksforgeeks.org/BASIC/testpage.html and 
if you are on http://google.com/ then it will take you 
to http://google.com/BASIC/testpage.html
III is valid because it takes you to the page corresponding to the 
current url of the page. Please note that if we use / before testpage.html, 
then it is respect to domain not the complete url.
IV is valid because it takes you to the container with class/name as 
test on the same page.
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?  
Cross
HTTP, SMTP, FTP
Tick
FTP, HTTP, SMTP
Cross
HTTP, FTP, SMTP
Cross
SMTP, HTTP, FTP


Question 8-Explanation: 
PROMPT-  Toggles prompting. Ftp prompts during multiple file transfers to allow you to selectively retrieve or store files  //Used for FTP transfers HEAD- The <head> element can include a title for the document, scripts, styles, meta information, and more //Used in HTML to transfer data across HTTP protocol RCPT- You tell the mail server who the recipient of your message is by using the RCPT command //Related to mail so,SMTP  
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.  

Cross

Only GET

Tick

Only POST

Cross

Either of GET or POST

Cross

Neither GET nor POST



Question 9-Explanation: 

Reasons: GET is NOT SECURE, whatever data you transfer is goes as part of URI and that\'s why it\'s visible to whole world, you can not send any confidential data using this method. POST sends data as part of HTTP request body, which can be encrypted using SSL and TLS. This is the reason all confidential data from client to server is transferred using POST method e.g. username and password when you login to internet banking, or any online portal. Read more at: http://java67.blogspot.com/2014/08/difference-between-post-and-get-request.html#ixzz3v2Sjr66R

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?
Cross
<!ELEMENT Book (title+, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type EMPTY> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>
Cross
<!ELEMENT Book (title?, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ATTLIST accno value (#PCDATA)>
Cross
<!ELEMENT Book (title*, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>
Tick
<!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 : 27 Sep, 2023

Share your thoughts in the comments
Similar Reads