wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

XML

Total questions: 82

Worksheet time: 44mins

Name
Class
Date
1.

Which are the main features of XML?

a)

Text data description

b)

Human- and computer-friendly format

c)

Handles data in a tree structure having one-and only one-root element

d)

All mentioned above

2.

Find the correct syntax of the declaration which defines the XML Version?

a)

< ?xml version= "1.0" ? >

b)

< xml version="1.0"/ >

c)

< ?xml version="1.0" / >

d)

None of the above

3.

Which language is case sensitive?

a)

HTML

b)

XML

c)

Both A & B

d)

None of the above

4.

Which are the techniques for defining the structure of a specific type of XML documents?

a)

Schema

b)

DTD

c)

Both A & B

d)

None of the above

5.

Which is not a XML function?

a)

Transport information

b)

Style information

c)

Store information

d)

Structure information

6.

Which Characters are illegal in XML elements?

a)

" < "

b)

"&"

c)

Both A & B

d)

None of the above

7.

Which are the XML Syntax rules?

a)

All XML Elements Must Have a Closing Tag

b)

XML Tags are not Case Sensitive

c)

XML Elements Must be Properly Nested

d)

Both A & C

8.

Well formed XML document means

a)

it contains a root element

b)

it contain an element

c)

it contains one or more elements

d)

must contain one or more elements and root element must contain all other elements

9.

In XML

a)

the internal DTD subset is read before the external DTD

b)

the external DTD subset is read before the internal DTD

c)

there is no external type of DTD

d)

there is no internal type of DTD

10.

Disadvantages of DTD are

(i)DTDs are not extensible

(ii)DTDs are not in to support for namespaces

(iii)there is no provision for inheritance from one DTDs to another

a)

(i) is correct

b)

(i),(ii) are correct

c)

(ii),(iii) are correct

d)

(i),(ii),(iii) are correct

11.

To use the external DTD we have the syntax

a)

<?xml version=”A.0” standalone=”no”?>

<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

b)

<?xml version=”A.0” standalone=”yes”?>

<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

c)

<?xml version=”A.0” standalone=”no”?>

<! DOCTYPE DOCUMENT “order.dtd”?>

d)

<?xml version=”A.0” standalone=”yes”?>

<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

12.

A schema describes

(i) grammer

(ii) vocabulary

(iii) structure

(iv) datatype of XML document

a)

(i) & (ii) are correct

b)

(i),(iii) ,(iv) are correct

c)

(i),(ii),(iv) are correct

d)

(i),(ii),(iii),(iv) are correct

13.

The attribute used to define a new namespace is

A. XMLNS

a)

XmlNameSpace

b)

XMLNS

c)

xmlns

d)

XmlNs

14.

Which of the following is a valid XSLT iteration command

a)

for

b)

for-all

c)

for-each

d)

in-turn

15.

______ tag is an extension to HTML that can enclose any number of JavaScript statements.

a)

<SCRIPT>

b)

<BODY>

c)

<HEAD>

d)

<TITLE>

16.

What is the correct JavaScript syntax to write "Hello World"?

a)

System.out.println("Hello World")

b)

println ("Hello World")

c)

document.write("Hello World")

d)

response.write("Hello World")

17.

What is the correct syntax for referring to an external script called " abc.js"?

a)

<script href=" abc.js">

b)

<script name=" abc.js">

c)

<script src=" abc.js">

d)

None of the above

18.

Which of the following best describes JavaScript?

a)

a low-level programming language.

b)

a scripting language precompiled in the browser.

c)

a compiled scripting language.

d)

an object-oriented scripting language.

19.

JavaScript is interpreted by _________

a)

Client

b)

Server

c)

Object

d)

None of the above

20.

<script type="text/javascript">

x=4+"4";

document.write(x);

</script>

Output------?

a)

44

b)

8

c)

4

d)

Error output

21.

Which page directive should be used in JSP to generate a PDF page?

a)

contentType

b)

generatePdf

c)

typePDF

d)

contentPDF

22.

application is instance of which class?

a)

javax.servlet.Application

b)

javax.servlet.HttpContext

c)

javax.servlet.Context

d)

javax.servlet.ServletContext

23.

“request” is instance of which one of the following classes?

a)

Request

b)

HttpRequest

c)

HttpServletRequest

d)

ServletRequest

24.

Which one of the following is correct for directive in JSP?

a)

<%@directive%>

b)

<%!directive%>

c)

<%directive%>

d)

<%=directive%>

25.

Java code is embedded under which tag in JSP?

a)

Declaration

b)

Scriptlet

c)

Expression

d)

Comment

26.

Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?

a)

The ErrorPage Attribute

b)

The IsErrorPage Attribute

c)

Both A & B

d)

None of the above

27.

Which technology do we mix our business logic with the presentation logic?

a)

Servlet

b)

JSP

c)

Both A & B

d)

None of the above

28.

In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?

a)

import

b)

contentType

c)

extends

d)

info

29.

In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?

a)

import

b)

contentType

c)

extends

d)

info

30.

Choose an incorrect statement from the following.

a)

JSP pages are easier to maintain than a servlet.

b)

The Web Container translate a Servlet into JSP page.

c)

JSP is built on Java Technology so it is platform independent.

d)

A JSP page seperates presentation and business logic.

31.

Which syntax is used to comment in JSP?

a)

<!-- Comment -->

b)

<@-- Comment -->

c)

<%-- Comment -->

d)

<&-- Comment -->

32.

Which is an example of the syntax used to import a class to JSP?

a)

<% page import="java.util.List" %>

b)

<%@ page import="java.util.List" @%>

c)

<% import="java.util.List" %>

d)

<%@ page import="java.util.List" %>

33.

Which of the following is syntax of Expression Tag?

a)

<% Expression %>

b)

<%= Expression %>

c)

<& Expression &>

d)

<%! Expression %>

34.

An __________ tag can hold any Java language expression that can be used as an argument to out.println() method.

a)

Expression tag

b)

Declaration Tag/label>

c)

Directive Tag

d)

Scriplet Tag

35.

Never end an expression with semicolon inside Expression Tag?

a)

True

b)

False

36.

Choose the correct syntax of include directive?

a)

<%@ include page="file.jsp" %>

b)

<% include file="file.jsp" %>

c)

<%@ include file="file.jsp" %>

d)

<%! include page="file.jsp" %>

37.

Servlet runs each request in a __________ ?

a)

OS shell

b)

JVM

c)

Separate thread

d)

JRE

38.

GenericServlet class is encapsulated inside __________ package

a)

java.lang

b)

javax.servlet

c)

java.servlet

d)

javax.servlet.http

39.

Which class provide implementation for service() method ?

a)

GenericServlet

b)

HttpServlet

c)

Servlet

d)

none of the above

40.

_________ is responsible for managing execution of servlet

a)

Web Container

b)

Servlet Context

c)

JVM

d)

Server

41.

Which method is called only once in Servlet life cycle ?

a)

service()

b)

initialize()

c)

init()

d)

all of the above

42.

Which of these classes define the getWriter() method that returns an object of type PrintWriter ? Select the one correct answer. ?

a)

HttpServletRequest

b)

HttpServletResponse

c)

ServletConfig

d)

ServletContext

43.

____________ object is available to any servlet or JSPs that are part of the web app and provides communication between servlets and JSPs.

a)

Servlet

b)

ServletConfig

c)

ServletContext

d)

HttpServletContext

44.

If the client has disabled cookie in the browser, which session management mechanism could the web container employ ?

a)

Session Management using Cookies

b)

Session Management using URL rewriting

c)

Either Cookies or URL rewriting

d)

Cookies and URL rewriting must be used together

45.

Which statement about HttpSession is not true?

a)

HttpSession object is used to store entire session with a specific client

b)

Any servlet can have access to HttpSession object through the getSession() method

c)

A session will become invalid as soon as the user close all the browser window

d)

Attribute can be stored, retrieved and removed from HttpSession object

46.

Which statement is true for request.getSession(true) method?

a)

if session already exist, it return the existing session else create a new session

b)

getSession(true) method always returns a new session

c)

getSession(true) method always returns a pre existing session

d)

none

47.

Which method is used access the cookies that are added to response object?

a)

getCookies()

b)

getNewCookies();

c)

cookies();

d)

returnCookies();

48.

Cookies are stored on _______ side.

a)

Client

b)

Server

c)

database

d)

none

49.

Which method is used to delete a session?

a)

invalidateSession()

b)

invalidate()

c)

deleteSession()

d)

delete()

50.

Given request is an HttpServletRequest, which code snippets will creates a session if one doesn't exist?

a)

request.getSession(false);

b)

request.createSession();

c)

request.getNewSession();

d)

request.getSession();

51.

Which method defined in the HttpServletRequest returns the object of RequestDispatcher ?

a)

getRequestDispatcher()

b)

getDispatcher()

c)

getRequest()

d)

requestDispatcher()

52.

Deployment Descriptor(DD) is a _________ .

a)

Servlet used to maintain other servlet.

b)

Text document

c)

XML document that is used by Web Container to run servlets and JSPs.

d)

Library file.

53.

Which implicit object is only available to a JSP page which is designated as error pages?

a)

application

b)

Throwable

c)

runnable

d)

exception

54.

Which implicit object of JSP is equivalent to this variable of Java programming language?

a)

page

b)

pageContext

c)

config

d)

application

55.

Which of the following is syntax of Declaration Tag?

a)

<@ Declaration @>

b)

<% Declaration %>

c)

<& Declaration &>

d)

<%! Declaration %>

56.

A JSP page consists of which tags?

a)

HTML tags

b)

JSP tags

c)

Both A & B

d)

None of the above

57.

How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?

a)

8

b)

9

c)

10

d)

7

58.

Which of the following are the valid scopes in JSP?

a)

request, page, session, application

b)

request, page, session, global

c)

response, page, session, application

d)

request, page, context, application

59.

“out” is implicit object of which class?

a)

javax.servlet.jsp.PrintWriter

b)

javax.servlet.jsp.SessionWriter

c)

javax.servlet.jsp.SessionPrinter

d)

javax.servlet.jsp.JspWriter

60.

Which of the following action variable is used to include a file in JSP?

a)

jsp:setProperty

b)

jsp:getProperty

c)

jsp:include

d)

jsp:plugin

61.

Which option is true about session scope?

a)

Objects are accessible only from the page in which they are created

b)

Objects are accessible only from the pages which are in same session

c)

Objects are accessible only from the pages which are processing the same request

d)

Objects are accessible only from the pages which reside in same application

62.

Which is not a directive?

a)

include

b)

page

c)

export

d)

useBean

63.

In JSP Action tags which tags are used for bean development?

a)

jsp:useBean

b)

jsp:setPoperty

c)

jsp:getProperty

d)

All mentioned above

64.

Which packages does a JSP API consist of?

a)

javax.servlet.jsp

b)

java.servlet

c)

javax.servlet.jsp.tagext

d)

Both A & C

65.

What is XML ?

a)

Extensible MarkUp Language

b)

Extra Modern Link

c)

Example markup Language

d)

X-Markup Language

66.

Any XML must have

a)

Closing tag

b)

Root element

c)

Nested child

d)

both a and b

67.

Which Statement about xml is true?

a)

Elements may have multiple atrribute with the same name

b)

Quoting attribute is optional.

c)

Elements may nest but not overlap

d)

All of the above.

68.

What is the correct declation syntax for the version of an XML document?

a)

</xml version="1.0"/>

b)

<?xml version="1.0"/?>

c)

<xml version="1.0">

d)

<!xml version="1.0">

69.

____________ is a term used about text data that will be parsed by the XML parser.

a)

CDATA

b)

PCDATA

c)

#DATA

d)

#CDATA

70.

How to describe XML data?

a)

XML uses a DTD to describe the data

b)

XML uses XSL to describe data

c)

XML uses a description node to describe data

d)

Both A and C

71.

Which statement is true?

a)

All XML elements must have a closing tag

b)

All XML elements must be lower case

c)

All XML elements must be lower case

d)

All the statements are true

72.

Which of the following XML documents are well-formed?

a)

<firstElement>some text goes here <secondElement>another text goes here</secondElement> </firstElement>

b)

<firstElement>some text goes here</firstElement> <secondElement> another text goes here</secondElement>

c)

<firstElement>some text goes here <secondElement> another text goes here</firstElement> </secondElement>

d)

</firstElement>some text goes here </secondElement>another text goes here <firstElement>

73.

Which of the following XML fragments are well-formed?

a)

<myElement myAttribute=someValue/>

b)

<myElement myAttribute="someValue"/>

c)

<myElement myAttribute=’someValue’>

d)

<myElement myAttribute="someValue’/>

74.

To use the external DTD we have the syntax

a)

<?xml version=”1.0” standalone=”yes”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

b)

<?xml version=”1.0” standalone=”yes”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

c)

<?xml version=”1.0” standalone=”no”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

75.

How many root elements can we have in XML ?

a)

1

b)

2

c)

3

d)

0

76.

What is XSLT?

a)

Extensible Standard Language Transformation

b)

Extensible Sytlesheet Language Transformation

c)

Extensible Standard List Transformation

d)

Extensible Sytle Language Transformation

77.

How many root elements can we have in XML ?

a)

1

b)

2

c)

3

d)

0

78.

What is XSLT?

a)

Extensible Standard Language Transformation

b)

Extensible Sytlesheet Language Transformation

c)

Extensible Standard List Transformation

d)

Extensible Sytle Language Transformation

79.

How XML describe data

a)

XML uses a description node to describe data

b)

XML uses a DTD to describe the data

c)

XML uses XSL to describe data

80.

which one of the following

is a layer of a computer

program which provides simplified access to data

a)

Business logic layer

b)

Data-access layer

c)

User interface layer

d)

Multi-layer applications

81.

which one is a sequence of characters used to identify or refer to a program or an element, such as a variable or a set of data, within it

a)

Elements

b)

Attributes

c)

Identifiers

d)

Validation

82.

The need of using a DTD in developing XML document is?

a)

Required when validating XML documents.

b)

No longer necessary after the XML editor has been customized.

c)

Used to direct conversation using an XSLT processor.

d)

A good guide to populating templates to be filled in when generating an XML document automatically.