HTML and XML
Question 1 |
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 |
Discuss it
Question 2 |
< 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) |
Discuss it
Question 3 |
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 |
Discuss it
Question 4 |
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 |
Discuss it
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 |
<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”> |
Discuss it
Question 6 |
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 |
Discuss it
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 |
-
<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 |
Discuss it
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 |
HTTP, SMTP, FTP | |
FTP, HTTP, SMTP | |
HTTP, FTP, SMTP | |
SMTP, HTTP, FTP |
Discuss it
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 |
Discuss it
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 |
<Book> <title> GATE 2005 </title> <type value = "BROCHURE"/> <accno>10237623786</accno> </Book> <Book> <type value = "FICTION"/> <accno>0024154807</accno> </Book>
<!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)> |
Discuss it