This document contains instructions for an assignment for a Web Technologies course. It includes 6 questions related to TCP vs UDP, features of XML, components of an XML processor, fetching data from XML to HTML, categories of PHP operators, and Active Server Pages (ASP). The questions range from short definitions and comparisons to longer explanations and examples.
â„đ 7737669865 đâ» Nandyal Call-girls in Women Seeking Men đNandyalđ Escorts...
Â
5010
1. ASSIGNMENT
DRIVE SUMMER 2016
PROGRAM MCA(REVISED FALL 2012)
SEMESTER 5
SUBJECT CODE &
NAME MCA5010-WEB TECHNOLOGIES
BK ID B1547
CREDITS 4
MARKS 60
Note: Answer all questions. Kindly note that answers for 10 marks questions
should be approximately of 400 words.
Q 1: Differentiate between TCP and UDP.
Ans : CP stands for âTransmission Control Protocolâ. TCP is a connection oriented
protocol in which the data can be transferred bidirectional after the setup of connection.
TCP is reliable but comparatively slow as it keeps the data smooth and checks error. The
order of data at receiving end is same as on sending end. Header size of TCP is 20 bytes.
UDP stands for âUser datagram Protocolâ. UDP is connectionless protocol in which data is
needed to be send in chunks. UDP donât have error checking mechanism that is why it is
less reliable but is more faster in data transferring. Header size of UDP is 8 bytes.
2. Differences:
ï§ TCP stands for âTransmission Control Protocolâ while UDP stands for âUser datagram
Protocolâ.
ï§ TCP is connection oriented protocol while UDP is connectionless protocol.
ï§ TCP is more reliable than UDP.
ï§ UDP is more faster for data sending than TCP.
ï§ UDP makes error checking but no reporting but TCP makes checks for errors and
reporting.
ï§ TCP gives guarantee that the order of data at receiving end is same as on sending
end while UDP has no such guarantee.
ï§ Header size of TCP is 20 bytes while that of UDP is 8 bytes.
ï§ TCP is heavy weight as it needs three packets to setup a connection while UDP is
light weight.
ï§ TCP has acknowledgement segments but UDP has no acknowledgement.
ï§ TCP is used for application that require high reliability but less time critical whereas
UDP is used for application that are time sensitive but require less reliability.
Q2: Describe the features of XML. What are the important rules to keep in mind
about the XML declaration?
Ans : XML is popular for many features and few of them are listed here:
1. Easy Data Exchange: In XML, data and markup are stored as text that we can
configure. If we like, we can use XML editors to create XML documents but if something
goes wrong we can examine and modify document directly because itâs all just text.XML
provides a very efficient way of storing most data. In addition, when we standardize
markup languages, many different people can use them.
2. Customizing markup language: We can create customized markup languages using
XML, and that represents its extraordinary power. We can create a customized browsers
to handle that language.
3. Self describing data: The data in XML document is self describing. We can create our
own tags in XML so that if we will go back to our document years later, we can figure out
whatâs going on.
4. Structured and integrated data: In XML document we can specify not only data but
the structure of that data can also be specified. When we are dealing with complex and
important data we can integrate various elements in to other elements.
5. Well-formed XML documents: XML document must follow the syntax rules set up
properly. Each element also must nest inside any enclosing elements properly. for
3. example if in any example of XMl we are opening a tag but not closing the same then it is
not a well formed XML document.
6. Valid XML document: An XML document is valid if there is a document type definition
(DTD) associated with it and if the document complies with that DTD.
There are few other important rules to keep in mind about the XML declaration:
a) The XML declaration is case sensitive: it may not begin with â<?XMLâ or any other
variant.
b) If the XML declaration appears at all, it must be the very first thing in the XML
document: not even whitespace or comments may appear before it; and
c) It is legal for a transfer protocol like HTTP to override the encoding value that you put in
the XML declaration, so you cannot guarantee that the document will actually use the
encoding provided in the XML declaration.
d) Elements may not overlap: an end tag must always have the same name as the most
recent unmatched start tag. The following example is well-formed XML document.
The following example shows the tags properly nested:
<Education><student>distance education </student>
SMUDE</Education>
An XML document has exactly one root element. As a result, the following example is not
a well-formed XML document, because both the university and books elements occur at
the top level:
<! -- WRONG! -->
<University>...</university>
<Books>...</Books>
The following example fixes the problem by including both the University and Books
elements within a new Education root element:
<Education>
<University>...</University>
<Books>...</Books>
</education>
If we use the structure of Sikkim Manipal University as a model for understanding the
structure of an XML document, we can easily understand the flow of our information in our
4. document. Figure 4.1 shows a tree structure of an XML document is similar to the
structure of Sikkim Manipal University.
Q 3: List and explain the Components of XML processor.
Ans: Parser
Every XML processor has a parser. An XML parser converts an XML document into an
XML DOM object - which can then be manipulated with a JavaScript. The parser's job is to
translate XML markup and data into a stream of bite-sized nuggets, called tokens, to be
used for processing. A token may be an element start tag, a string of character content,
the beginning delimiter of a processing instruction, or some other piece of markup that
indicates a change between regions of the document.
we have conversed about XML parsing process operates in three phases:
Stage 1: In this stage, the application parses and validates the source document;
recognizes and searches for relevant information based on its location or its tagging in the
source document; extracts the relevant information when it is located; and, optionally,
maps and binds the retrieved information to business objects.
Stage 2: Business logic handling. This is the stage in which the actual processing of the
input information takes place. It might result in the generation of output information.
Stage 3: XML output processing. In this stage, the application constructs a model of the
document to be generated with the Document Object Model (DOM). It then either applies
XSLT style sheets or directly serializes to XML.
b) Event switcher
The event switcher receives a stream of tokens from the parser and sorts them according
to function, like a switchboard telephone operator of old. Some tokens signal that a
change in behavior is necessary. These are called events. One event may be that a
processing instruction with a target keyword significant to the XML processor has been
found. Another may be that a <title> element has been seen, signaling the need for a font
change. What the events are and how they are handled are up to the particular processor.
On receiving an event, it routes processing to a subroutine, which is called an event
handler or sometimes a call-back procedure. This is often all that the XML processor
needs to do, but sometimes more complex processing is required, such as building and
operating on an internal tree model.
c) Tree representation
The tree representation can take many forms, but there are two main types.
i) The first is a simple structure consisting of a hierarchy of node lists. This is the kind of
structure you would find in a non-object- oriented approach.
5. ii) The other kind is called an object model, where every node is represented as an object.
In a programming phrase, an object is a package of data and routines in a rigid, cloudy
framework. This style is preferred for large programs, because it minimizes certain types
of bugs and is usually easier to visualize. Object trees are expensive in terms of speed
and memory, but for many applications this is an acceptable trade-off for convenience of
development.
d) Tree processor
The tree processor is the part of the program that operates on the tree model. It can be
anything from a validity checker to a full-blown transformation engine. It traverses the tree,
usually in a methodical, depth-first order in which it goes to the end of a branch and
backtracks to find the last unchecked node. Often, its actions are controlled by a list of
rules, where a rule is some description of how to handle a piece of the tree. For example,
the tree processor may use the rules from a stylesheet to translate XML markup into
formatted text.
Q 4: Describe the procedure of fetching data from XML to HTML. Give an example.
Ans: The process of fetching data from an XML files to be filled in an HTML table, using
DSO (Data Source Object) and JavaScript. DSO is an object that operates like a database
on the client side. It will accept information that is organized in a certain way and will
manipulate it with its own database engineâŠ ï· For example
<CAPTION>
< span class = â style1â > example </span>
</caption>
Q 5 : Describe five different categories of PHP Operators
Ans : There are many operators used in PHP, few of them are : ï· Assignment Operators:
are used to set a variable equal to a value or set a variable to another variable's value.
Such an assignment of value is done with the "=", or equal character. ï· Arithmetic
Operators: are used to perform mathematical operations like addition, subtraction,
multiplication, division and Modulus. ï· Comparison Operators: Comparisons are used to
check the relationship between variables and/or values. Comparison operators are used
6. inside conditional statements and evaluate to either true or false. ï· String Operators: is
used to add two strings together, or more technically, the period is the concatenation
operator for strings. ï· The Concatenation Operator: The concatenation operator (.) is used
to put two string values together.
Q 6 : Describe about ASP.
Ans : Active Server Pages (ASPs) are Web pages that contain serverside scripts in
addition to the usual mixture of text and HTML (Hypertext Markup Language) tags.
Server-side scripts are special code that is put in Web Pages and that code is processed
before it is sent to the Web browser of someone who's visiting your Web site. When we
type a URL in the Addressbox or click a link on a Web page it means we are asking a
Web server to send a file to the Web browser on our computerâŠ.. ï· Following are some
steps that will help us to know about ASP working: o The user brings up a Web site where
the default page has the extension .asp. o The browser requests the ASP file from the
Web server.
o The server-side script begins to run with ASP. o ASP processes the requested file
sequentially (topdown), executes any script commands contained in the file, and produces
an HTML Web page. o The Web page is sent to the browser. Because our script runs on
the server, the Web server does all of the processing and standard HTML pages can be
generated and sent to the browser