HTML and XML
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 1 Explanation:
Consider the HTML t able definition given below:
The number of rows in each column and the number of columns in each row are:
|< 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>|
(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 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: www.w3schools.com http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_td
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
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 and 4 only
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.
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?
Question 5 Explanation:
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.
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
Well-formed and validated
Well-formed but not validated
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
Given below are several usages of the anchor tag in HTML.
<A HREF = "http://www.gate.ac.in/HTML/BASIC/testpage.html">Test Me</A>
<A HREF = "/BASIC/testpage.html">Test Me</A>
<A HREF = "testpage.html">Test Me</A>
<A HREF = "testpage.html#test">Test Me</A>
I and II only
I and III only
I, II and III only
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.
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 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
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.
Either of GET or POST
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 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
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 14 questions to complete.