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?
A
Embed web objects from different sites into the same page
B
Refresh the page automatically after a specified interval
C
Automatically redirect to another page upon download
D
Display the client time as part of the page
GATE CS 2011    HTML and XML    
Discuss it


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:
A
(2, 2, 3) and (2, 3, 2)
B
(2, 2, 3) and (2, 2, 3)
C
(2, 3, 2) and (2, 3, 2)
D
(2, 3, 2) and (2, 2, 3)
GATE-CS-2009    HTML and XML    
Discuss it


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?
A
The content becomes easy to manage
B
Becomes easy to make site for different devices like mobile by making separate CSS files
C
CSS Files are generally cached and therefore decrease server load and network traffic.
D
All of the above
HTML and XML    
Discuss it


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.
A
2 only
B
1 only
C
2 and 4 only
D
3 and 4 only
HTML and XML    GATE-CS-2015 (Set 1)    
Discuss it


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?
A
<a.href: “http://www.yourname.com/”, href: “...var.html”>
B
<base href: “http://www.yourname.com/”>
C
<a.href: “http://www.yourname.com/”>
D
<base href: “http://www.yourname.com/”, range: “...var.html”>
HTML and XML    GATE-CS-2015 (Set 3)    
Discuss it


Question 5 Explanation: 
Question 6
Consider an XML file called intro.xml and a document type defintion (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
A
Well-formed and validated
B
Well-formed but not validated
C
Validated but not well-formed
HTML and XML    GATE-IT-2004    
Discuss it


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?
A
I and II only
B
I and III only
C
I, II and III only
D
I, II, III and IV
HTML and XML    GATE-IT-2004    
Discuss it


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?  
A
HTTP, SMTP, FTP
B
FTP, HTTP, SMTP
C
HTTP, FTP, SMTP
D
SMTP, HTTP, FTP
HTML and XML    Gate IT 2005    
Discuss it


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.  
A
Only GET
B
Only POST
C
Either of GET or POST
D
Neither GET nor POST
HTML and XML    Gate IT 2005    
Discuss it


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 transffered 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?
A
<!ELEMENT Book (title+, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type EMPTY> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>
B
<!ELEMENT Book (title?, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ATTLIST accno value (#PCDATA)>
C
<!ELEMENT Book (title*, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>
D
<!ELEMENT Book (title?, type, accno)> <!ELEMENT title (#PCDATA)> <!ELEMENT type EMPTY> <!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>
HTML and XML    Gate IT 2005    
Discuss it


Question 11
HELO and PORT, respectively, are commands from the protocols  
A
FTP and HTTP
B
TELNET and POP3
C
HTTP and TELNET
D
SMTP and FTP
HTML and XML    GATE IT 2006    
Discuss it


Question 11 Explanation: 
  Simple Mail Transfer Protocol (SMTP) : It is an Internet standard used for transmitting email. Electronic mail servers and other mail transfer agents use SMTP to send and receive mail messages. The client sends 'HELO' command to the SMTP server to identify itself and initiate the SMTP conversatio. File Transfer Protocol (FTP) : It is a network protocol used to transfer computer files between a client and server on a computer network. FTP communications use two port number values -- one for commands (port 21 by default), and one for data transfer. This is where the PORT command comes into play. The PORT command is sent by an FTP client to establish a secondary connection (address and port) for data to travel over. This solution is contributed by Mohit Gupta .  
Question 12
Consider the XML document fragment given below:
2007_19
With reference to the HTML lines given above, consider the following statements.
1. Clicking on the point <80, 75> does not have any effect.
2. The web browser can identify the area applicable to the mouse-click within the image and the subsequent action to be taken without additional responses from the web server.
3. The dots in the cgi-bin URL will be resolved by the web browser before it is sent to the web server
4. The "fd.html" request when sent to the web server will result in a GET request.
Exactly how many of the statements given above are correct?
A
0
B
1
C
2
D
3
HTML and XML    Gate IT 2007    
Discuss it


Question 13
Consider the XML document fragment given below:
2007_20
Consider the XPath expression: *[not (self ) : : TOC]
What would be the result of the given XPath expression when the current node is Book?
A
The Title and Content elements
B
The Content and TOC elements
C
The Title and TOC elements
D
The Title Content and TOC elements
HTML and XML    Gate IT 2007    
Discuss it


Question 13 Explanation: 
Out of Syllabus now
Question 14
Which of the following is TRUE only of XML but NOT HTML?
A
It is derived from SGML
B
It describes content and layout
C
It allows user defined tags
D
It is restricted only to be used with web browsers
HTML and XML    Gate IT 2008    
Discuss it


Question 14 Explanation: 
SGML (standard generalized markup language)
both xml and html are derivative of SGML
Both xml and html describes layout and content
both are restricted to be used with web browsers
xml allows user defined tags but HTML-4 does not
There are 14 questions to complete.

GATE CS Corner


See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.