B.Tech Project Report: Development of Online Computer Based Test Suite, To Be Deployed On
B.Tech Project Report: Development of Online Computer Based Test Suite, To Be Deployed On
B.Tech Project Report: Development of Online Computer Based Test Suite, To Be Deployed On
ACKNOWLEDGEMENT
We express our sincere gratitude and thanks to all those who have helped us in
the completion of this project.
Of all the persons who have helped us, we would first of all like to thank Mr.
Madhup Sharma, Senior Project Manager (uCertify.com), under whose able
guidance we have completed our project and who helped us at each and every
stage of our project.
We would also like to extend our gratitude to Mr. Prashant Gupta, CEO,
uCertify.com and his team Ms Priya, Mr. Varun, Mr. Deepak Jaiswal and
everybody else at uCertify.com for their cooperation and valuable support in
every way during the period of the project.
Pratyush
Pravi Tripathi
Eighth Semester
IIIT-Allahabad
major
internationally
recognized
computer
MCSE
MCSD
MCDBA
MCSA
CompTIA
Java Certification
CIW
Oracle
Assignment I
To Develop a Online Test Suite, to be
deployed on www.uCertify.com
Time Line
Problem Analysis
10%
Study
30%
Module Division
5%
Design
10%
40%
5%
Table Of Content
1.
2.
3.
4.
5.
6.
7.
Abstract
Introduction
Problem Definition and Analysis: requirements
Design and Implementation
Testing and Deployment
Future Enhancements
Bibliography
Abstract
Companies existing on the web have several constraints. The primary
constraint with such companies is the way they interact with their customers.
The customer has to have an internet access for sufficiently long time before
they can really impress her and sell their product. Companies long for a
solution that can be viewed offline with almost same features as online ones
should be small in size and should protect their IPR. We have here tried to
explore a solution for such a scenario. The company, uCertify.com has been in
the business of selling online test preparation kits and wants a solution to reach
to its customers online as well as offline.
We propose the use of web technologies like DHTML and XML for designing
such a solution. The solution thus designed has the advantage of being used
into their flagship product uCertify PrepEngine and the PrepKit to render it
more flexibility and extensibility.
Introduction
Since advent of the computer aided learning paradigm, many companies have
started their online courses related to their technologies and products. To name
a few are like Cisco Certified Networking Administrator (CCNA), Microsoft
Certified Systems Engineer (MCSE) and Microsoft Certified Software
Developer (MCSD). These companies give a certification subject to clearing all
of their online tests under certain category. To cater the need of this growing
market segment, where online test preparation kits hold a great popularity,
uCertify has been in the forefront, developing simulation test preparation kits.
We as working with their team of creative professionals were given a task to
develop an online test kit on the lines of Microsoft, along with careful analysis
of competitors softwares for the similar purpose, so that we could create a
place for uCertifys software products. Major constraints before us were
performance along with reliability i.e. a user should not experience any glitches
and error messages while undergoing the online test. Also the interface along
with the usage procedures had to be as simple and user friendly as possible.
In such kind of application user interface design plays an important factor
when one has to compete with various other products of different companies.
The user will definitely opt for the one he feels more comfortable and user
friendly rather than one with complex features and handling issues.
Example:
A. Answer option 1
B. Answer option 2
Example:
A. Answer option 1
B. Answer option 2
10
Scenario-Based
Scenario-based questions are based on scenarios and exhibits The question
requires the test taker to rate the suggested solution in terms of its aptness in
meeting the required and the optional results mentioned in the question.
Exhibit-Based
Some questions include exhibits that act as supporting pictorial information for
the question. These exhibits are generally used to explain the scenario in the
question and help the test taker to understand the question. The Exhibit-Based
questions may have single correct or multiple correct answers or may even
require the test taker to Drag & Drop the correct answer in the placeholder
provided, or simulate the question in the exhibit, or click on the Hot Spot in the
exhibit. Other types of questions, which may have an exhibit, are Choose and
Reorder the List, Create a Tree and Establish a Relationship.
11
Hot Spot
In Hot Spot type questions, the test taker will be required to mark the appropriate
area on the image in the Hot Spot window.
12
13
14
Create a Tree
To answer Create a Tree type questions, the test taker must select the
appropriate item from the list of items on the right side of the screen and place
them under the node of the tree.
To add Items under the nodes, she should select the destination node on the left
side of the screen, select the item from the list of items on the right side of the
screen, and then click the left arrow button to move the items.
To remove an item from the tree, she can select the item and click the right arrow
button, or she can drag the item from the tree back to the list of items on the right
side of the screen.
Question grading:
Two points are awarded for each item that appears under the correct node in the
tree. One point is deducted for each incorrect item. The minimum score is zero
15
Establish a Relationship
These type of questions present the test taker with several connectors that she
can use to join the objects on the screen. Depending on the question, she should
connect the objects using the appropriate connector from either the Relationships
box or the Data connector box.
To create relationships between two objects, she should first drag the two objects
to an open area of the screen. Next, use shift + click to select two objects she
wants to connect. Once she has selected the object, the object border changes
and shows a 3D-lowered effect. To deselect the object, point to the object and
use shift + click again. She must select two objects before she can choose a
connector to create a relationship. While defining relationships only two objects
should be selected at one time. If two objects are already selected and the test
taker wants to select another object, she must first deselect one of the objects.
After selecting the two objects, double-click the connector she wants to place
between the two objects. She can place a maximum of three connectors between
two selected objects. To remove a connector between two objects, she must
right-click the connector she wants to remove. Right clicking brings up a pop-up
menu from which she can select the Delete option to remove the relationship
connector. To reverse the defined relationship of the connector, right-click the
connector and select the Reverse option. Simply moving two objects on the
screen will not change the relationship.
Question grading:
Each correct relationship between two objects is worth four points. One point is
awarded for each correctly selected object that exists in the relationship. One
point is given for identifying the correct relationship, and one point for identifying
the correct direction of the relationship. Two points are deducted for each
incorrectly identified relationship between two objects. The minimum score is
zero.
16
17
Consequently, the main aim was to migrate the existing data from RDBMS to
an XML file. We worked separately on this module, providing extra
functionality of exporting files of a remote database, through a web server and
capturing it in form of XML.
The conversion of this RDBMS to XML required additional design issues that
could faithfully depict the relations and hierarchy that was already stored in the
database.
The solution designed can be explained with the help of the following block
diagram.
uCertify
Question
Database
XML
Data Module
Test Module
UI Creation
Navigation
Event Response
Result
Exhibit
The company decided to keep the online test application on the web for
promotional purposes. Making a rigid application would hamper the size
considerations. Also, just keeping a webpage on the web for testing requires the
19
test taker to be online for a considerable period of time. Considering the large
variety of test takers, this was a big assumption to make. Hence, after
considering all the possible alternatives, we finally settled on developing a single
module that could function as a standalone test, but light weight in size. An
application with all its dlls is demanding in size. The best alternative was a
Compiled Help Module, or commonly called a CHM file. A CHM file is a
Microsoft standard for making HTML help for applications, and is very widely
used by software vendors to include product help. The file being just a single
one, is easy to download on the web for offline viewing by a prospective client.
Also, the CHM compiler compresses the data while compiling, thereby
reducing the size further. All the facilities available in scripting languages work
effectively in such file, with extra functionality of full text search and index.
Although full text search and indexes were not required with this application,
nevertheless, it is an important tool with the company can enhance the user
experience of their online test module in future, whenever desired so.
A compiled help module also hides the coding from an end user, thus
safeguarding commercial aspirations of the company from its competitors.
Other information also includes the exhibit name and its type, if any, the
number of answers, and number of choices.
Also, a separate database takes care of storage of respective answer options and
the correct ones in them. The database also stores whether a question is a
normal question, with a single/multiple answer or is a question of special
module. The demarcation of special module questions is essential as its
comparatively challenging to implement these questions and check their
answers. For example, there is no single and efficient method of checking
special module of relationship forming, that is normally asked in database table
relationship questions. The user might choose potentially an infinite
combination from the displayed combination of databases on the screen, and
can relate them in another infinite ways, though such infinite choices normally
do not arise with limited databases displayed, the choices do multiply up to
large numbers. User answer checking does become a challenge under these
circumstances.
There are additional problems associated with the keeping of the choices and
correct options in questions relating to choose and reorder type and the
treeview type of questions.
Following is the snippet of a node of the XML file, company now uses as the
database for online testing.
- <QUESTIONS PAPER_CODE="M70-100" PAPER_NAME="Analyzing Requirements
and Defining Solution Architectures">
"
- <QUESTION UCID="0004135" CASEID="0000000" IMG="" Q_TYPE="0">
- <DETAIL>
- <![CDATA[
You are working on an application using Visual Basic as the front-end and
SQL Server as the back-end. Both, Visual Basic and SQL Server, run on
the same machine. Which application model does this application use?
]]>
</DETAIL>
- <ANSWERS>
- <ANSWER UCID="0012492" CORRECT="0" USERANS="0">
- <![CDATA[
N-tier
]]>
</ANSWER>
- <ANSWER UCID="0012490" CORRECT="0" USERANS="0">
- <![CDATA[
Single-tier
]]>
</ANSWER>
- <ANSWER UCID="0012493" CORRECT="0" USERANS="0">
- <![CDATA[
21
Following tags and attributes are used to store relevant information in the XML
file
1. PAPER_CODE: Microsoft specified code name of a particular test
2. PAPER_NAME: stores the name of a particular paper.
22
23
Data Module:
The data module takes the responsibility of parsing the XML database provided
into a runtime data structure. This data structure generated during runtime is
then used throughout the interaction scenario. All the user events are captured
into this data structure and the same data structure is then used when working
in review mode or result generation time. When working in the review mode,
the user is allowed to see his answer of a question, and the correct answer side
by side so that he may compare and see his mistakes. The analysis of the
question is also displayed at that time. All these fields need to be read and fed
into a database so that they may be generated on runtime.
24
User ID
User Answer
User Answers
Detail
Current Position
Case Name
Question Type
Result
The structure of the data structure designed can be explained by the following
code snippet:
function question()
{
this.detail;
this.id;
this.caseid;
this.img;
25
this.answers;
this.totalcorrect;
this.totalans;
this.analysis;
this.smcorrectans;
this.smuserans;
this.smcurrentpos;
this.smcurrentpos1;
this.casename;
this.q_type;
this.result;
}
This is a structure declared in JavaScript. All the fields correspond to the fields
of the XML database.
Answers are stored in the subfield answers, which are further declared at
runtime to be a structure of the type ans. The structure ans can be defined as:
function ans()
{
this.id;
this.correct;
this.userans;
this.detail;
}
These, then form array of structure during the runtime to keep track of
questions and their interaction with the user. Note that all these data elements
declared are not specifically typecast. The type of these elements is decided by
JavaScript at the run time.
26
Test Module:
The test module is the one dealing with generation of the online test ans user
interaction. It can be divided into following main submodules:
1. Test module
a. UI Creation
b. Event capture
i. Navigate event
ii. Show exhibit event
iii. Result generation
iv. Review mode
UI Creation:
The user interface created depends on the type of question asked. If it is a
single answer type question, the options must accompany radio button grouped
together so that only a single selection can be made. If it is a multiple answer
type question, check boxes need to be made. Complex measures are adopted if
any of the special module questions are to be asked. The UI creation module
also takes care of initializing the user answer datastructure so that any
interaction can faithfully be reproduced when navigating back and forth or in
review mode. Also, steps need to be taken to evaluate user response depending
upon the type of question asked.
Further implementation details shall be discussed according to the different
question scenarios.
Event Capture:
This submodule deals with the interpretation of user response to a question.
The events are broadly divided into 4 categories. The navigate event essentially
maintains a state variable to keep track of current question.
The variable curq holds value of surrent question. This variable is incremenred
or decremented depending on the direction of navigation. The following code
snippet demonstrates the loading of a new question based on the present value
of the variable curq.
27
var rc;
rc = curq + 1;
pos.innerHTML = rc + "/" + totalq;
var uans,casedetail;
casedetail ="";
pagecontent = "<table border=0><tr><td id=qresult> </td></tr></table>"
if (questions[curq].casename !="")
{
casedetail = '<a href="'+ "c"+questions[curq].caseid+".htm" + '"
target="_blank">'+questions[curq].casename+'</a>'
}
pagecontent = pagecontent + "<table border=0><tr><td>"
+casedetail+"</td></tr></table>"
pagecontent = pagecontent +"<div class=question><b>Q: </b>" +
questions[curq].detail + "</div>";
pagecontent = pagecontent + specialinstruntction(questions[curq].q_type);
pagecontent = pagecontent + '<FORM name = "testform"
ACTION="&[documenturl];action=show" METHOD="POST"><table>';
for (var i = 0; i < questions[curq].totalans; i++)
The result generation and review mode both work in similar manner. A
Boolean state variable identifying whether the test is in "test" mode or "review"
mode is set true to signify review mode. When working in the review mode.
Answer options are disabled and analysis is displayed along with a question.
Also, there is an option to see correct solution or the solution given by the
user. All these values are fetched from the data structure that keeps track of
user activity with a particular question. The information about user moves is
stored in the data structure called ans.userans which is used to display when
working in the review mode or during navigation.
The show exhibit event occurs when there is either a case study or an exhibit
associated with a question. The name of the case study or image is given in the
xml tags with same name. When a show exhibit event occurs, these data
structures are searched for adequate information, and if present, they are
fetched and displayed. Another thing to notice is that the even show exhibit is
tied down to the onclick event of a button at the bottom corner of the screen,
and it is disabled if the question provides no exhibit or case study.
The UI module and the test module simultaneously implement functions that
deal with all kinds of question scenarios that can occur in an online test. A
28
if(reviewmode)
{
pagecontent = pagecontent +
"<tr
valign='top' align='left'><td width='10'><img src='RB"+uans+".GIF' height=20
width=20></td><td><b>"+ String.fromCharCode(i + 65) + ". "+"</b>" + sca +
29
questions[curq].answers[i].detail
+
eca+
"</td></tr><tr><td> </td><td> </td></tr>";
}
else
{
pagecontent = pagecontent + "<tr valign='top'
halign='left'><td width = 1%><input type='radio' " + strchecked + " name='ans'
value='1' onClick='uans(" + i +")' > </td><td width = 1%><b>" + String.fromCharCode(i
+ 65) + ". " + "</b></td><td ><a href = name='ansstr' class='menu_link' " + ls_href + "
onClick='uans(" + i + ");return false'>" + questions[curq].answers[i].detail +
"</a></td></tr><tr><td> </td><td> </td></tr>";
}
if(reviewmode)
{
pagecontent = pagecontent +
"<tr
valign='top' align='left'><td width='10'><img src='CB"+uans+".GIF' height=17
width=20></td><td><b>"+ String.fromCharCode(i + 65) + ". "+ "</b>" + sca+
questions[curq].answers[i].detail
+
eca+
"</td></tr><tr><td> </td><td> </td></tr>";
}
else
{
30
pagecontent = pagecontent +
"<tr
valign='top' align='left'><td width = 10><input type='checkbox' " + strchecked + "
name='ans" + i + "' value='1' onClick='uans(" + i +")' > </td><td width = 1%><b>" +
String.fromCharCode(i + 65) + ". " + "</b></td><td ><a href= name='ansstr'
class='menu_link' " + ls_href + " onClick='uans(" + i + ");return false'>" +
questions[curq].answers[i].detail
+
"</a></td></tr><tr><td> </td><td> </td></tr>";
}
31
Parent Image
A major problem that DHTML poses is that no such even as drag and drop
has been devised. Languages such as VB and others support a native
implementation of drag and drop. For DHTML, this support was absent. So a
32
simulation of dragging and dropping was designed for these types of questions
in the UC online test.
The use of layers gives the flexibility of superimposing one object over the
other. For drag and drop, two identical images are displayed one over another,
with one of them as invisible. The algorithm can be written as:
1. On mousedown event over dragable object
a. Toggle invisible image as visible
b. on mousemove event
i. set image co-ordinates = mouse position
c. on mouseup event, check if co-ordinates correspond to container
i. if yes, set container image = dropped image
ii. if no, toggle image as invisible
This algorithm very beautifully simulates the required drag and drop event for
the UC online test.
Correct answer of this type of question is kept as html script, which is displayed
when the user wishes to see the correct answer. His response to this question is
also kept as html snapshot.
This process can be explained in the following figure:
User
Response
HotSpot
34
The solution for this problem was found in the Select box.
The select element creates a menu. Each choice offered by the menu is
represented by an option element. A select element must contain at least one
option element.
The optgroup element allows authors to group choices logically. This is
particularly helpful when the user must choose from a long list of options;
groups of related choices are easier to grasp and remember than a single long
list of options. In HTML 4, all optgroup elements must be specified directly
within a select element (i.e., groups may not be nested).
A major limitation of the select box was that of scrolling. Select box does not
provide native option for horizontal scrolling. Scrolling is only provided for
long vertical list. The select box wraps itself around long text.
A working solution to this problem was devised by using a parent container
along with select box as its child, thereby utilizing the scrolling features of the
parent to scroll complete select box.
35
Choosing and reordering of options in one of the select box utilizes the DOM
object of the same. The DOM object provides functionality for swapping of
internal nodes in the select box.
}
}
}
}
CheckResult(aSel,checksort);
}
o
o
o
one
two
three
o
o
three one
three two
three two one
three two two
three three
four
five
37
</ul>
There are three noticeable problems in such an approach. One of the margin
images, which by default are round or square bullets, second of large indenting
and finally the list, is passive. By list being passive we imply that the list does
not respond to collapsing or expanding actions, like normal lists do.
The problem of formatting was solved by using .CSS stylesheets to identify
nodes and setting margin images and indenting for the list.
.node1{list-style-image:url('node1.gif');margin-left:20}
.node2{list-style-image:url('node2.gif');margin-left:20}
.node3{list-style-image:url('node3.gif');margin-left:20}
.node4{list-style-image:url('node4.gif');margin-left:20}
.node5{list-style-image:url('node5.gif');margin-left:20}
Each list node was given a unique name and was assigned a unique picture. The
indenting was set using the margin set property. The assumption taken is that
never in a question one encounters a list having more that five subtrees inside a
node. Thus the hierarchy would finally look like:
node1
o node2
node3
node4
o node5
For lists beyond the scope of this hierarchy, a simple addition of one more
node with similar settings would do.
38
39
40
41
42
Assignment II
To develop a generic ASP based toolkit
for remote database manipulation, with
intermediate data transfer in XML
43
Table of Content
1.
2.
3.
4.
5.
6.
7.
8.
Abstract
Introduction
Problem Definition and Analysis
Design and Implementation
Testing and Deployment
Future Enhancements
Epilogue
Bibliography
44
Abstract
Remote database manipulation has long been an area of constant product and
solution development. Major concerns of code developers are primarily the
ease of use, generality of the solution, easy maintenance of system and above all
ease of integration across various platforms and solutions. These concerns
transform such problem into a multiple constraint job. While one factor
compels use of a technology, other discourages it. Here we have tried to strike
a sensible balance. Our main stress has been to design a solution that could be
seamlessly integrated with a gamut of products. Consequently, we decided
upon using a vendor neutral medium of data communication between the client
and the server, XML. Use of XML allows us to fetch data from a remote
database from a variety of platforms and different applications, conforming to
XML data interchange standard.
45
Introduction
A lot of work is being done these days in the area of vendor neutral data
standard of communication between processes for exchange of messages and
data. The effort of the XML group has been in the forefront in this regard. We
have tried to take advantage of this standard that can be easily employed to
depict hierarchical ordering of data and its relative positioning. Use of HTML
like style sheets enables formatting of the data at the same time, thereby
enabling XML to act as a total data facilitator. The same concept was used
while designing of this project. When a remote database needs to be updated,
the only method available to database administrators was either make an online
form, using ASP and related authentications to display the data online and then
let the data entry operator edit it. The other approaches were writing of a
custom application to do the job, which in all cases was a lengthy process, and
often proved cumbersome in scenarios where computers on different
platforms needed to interact. The final brute force approach was to replace the
entire database file altogether.
The clear solution visible in such scenarios was to develop an application that
could remotely manipulate the data reliably. Working along the same lines we
discovered that using some custom protocol for data transfer while on one side
reduces network overhead, it heavily limits the scope and generality of the
solution developed. Hence we focused on the use of XML for data transaction
between client and the server. This provides a loosely coupled architecture that
is not only independent of the client-server platform but is also scalable and
generic.
46
47
Web Server
Connection
request +
Authentication
ASP
XML
Processor
XML Response
Query
Record set
Database
Client Application
The overall design can be broken down into three main modules, the client
application, the server encapsulating the database and the xml processor.
Further details of the modules can be discussed as follows.
48
IIS Architecture:
The standard Internet Services (FTP and Web servers) reside in a process
called Inetinfo. In addition to the Internet services, this process contains the
shared thread pool, cache, logging, and SNMP services of Internet Information
Server. File Transfer Protocol (FTP) is the protocol used to transfer files
between two computers on a network that uses Transmission Control
Protocol/Internet Protocol (TCP/IP). FTP was one of the earliest protocols
used on TCP/IP-based networks and the Internet. Although the World Wide
Web has replaced most of the functions of FTP, FTP is still a reliable way to
copy files from a client computer to a server over the Internet.
Internet Information Server is integrated with Microsoft Windows NT Server.
IIS uses the same directory database (user accounts) as Windows NT Server.
Using the same directory database eliminates the need for additional user
account administration. Internet Information Server administration also uses
existing Windows NT Server tools such as Performance Monitor, Event
Viewer, and Simple Network Management Protocol (SNMP) support to
maintain similar administrative procedures.
49
IIS Architecture
Programmability Architecture
Web applications are maturing to become mission-critical, line-of-business
applications. Before the Web, most applications were written and executed on
stand-alone computers as single-user applications, and most shared server code
was written and executed within databases. Web applications are deployed in a
distributed, disconnected environment often running on many different data
stores. IIS adds the necessary technologies to the Windows NT Server platform
so that organizations can develop and deploy reliable and scalable multi-user
Web applications.
The diagram below illustrates the programmability architecture of IIS and the
components described in this section.
50
51
INTRODUCTION TO ASP
An Overview
Active Server Pages is an open, compile-free application environment in which
we can combine HTML, scripts, and reusable ActiveX server components to
create dynamic and powerful Web-based business solutions. Active Server
Pages enables server-side scripting for IIS with native support for both
VBScript and Jscript
Simply put, Active Server Pages (ASP) is a mix of HTML, scripts and ASP
code that enables us to build dynamic and database-driven web sites. Microsoft
describes it as "a server - side scripting environment that we can use to create
and run dynamic, interactive, high - performance Web server applications."
While standard HTML is only a display language, ASP allows us to tailor the
information displayed on the page based on user interaction.
Like other tools such as Perl and CGI, server-side ASP is interpreted by the
server and the information is returned to the browser to display. Therefore,
ASP is cross - browser compatible if used as server-side scripting - in other
words, if the script is interpreted on the server, is server-side. There are certain
things that will not work, however, if a browser does not accept cookies - we
will not be able to use scripts that require session variables and/or cookies.
There is also client-side scripting, which is interpreted by the browser. We can
definitely do some very cool things with client-side scripting, but unfortunately,
we're faced with browser compatibility issues if this is the way we go. However,
if one is aware of and can work around compatibility issues, using client-side
scripting can help take a load off her server - a definite boon for heavily
accessed sites.
52
Make requests of the HTTP header information gathered from the user's
browser
Traditionally, the way one would communicate with a server was through
HTML forms. Data entered into a form by a user was submitted to a server
CGI program that would, in turn, create an appropriate HTML response.
Another way was to append parameters to the end of a URL to create a query
string. The URL would look something like this:
http//localhost?ID=0&FORMAT=1
The Active Server Pages object model enables us to retrieve this information so
that it can be used in ASP scripts. The client- and server-side data that can be
collected provides the intelligence the developer needs to be able to make
flexible, user-interactive Web pages.
The ASP object model forms a hierarchy with the Server object at the pinnacle.
The properties and methods of this object can be used to make your scripts
even more powerful by providing one with tools to manage her application.
The other four main objects, together, round out the Active Server application.
These objects are called Request, Response, Application, and Session
55
56
57
Of course, one could have done the same thing in HTML, but one wouldn't
be able to process the data with search programs and address-extraction
programs and the like. More importantly, since XML is inherently style-free,
one can use a completely different stylesheet to produce output in
postscript, TEX, PDF, or some new format that hasn't even been invented
yet. That flexibility amounts to what one author described as "futureproofing" your information. The XML documents authored today can be
used in future document-delivery systems that haven't even been imagined
yet.
Inline Reusabiliy
One of the nicer aspects of XML documents is that they can be composed
from separate entities. One can do that with HTML, but only by linking to
other documents. Unlike HTML, XML entities can be included "in line" in
a document. The included sections look like a normal part of the document
one can search the whole document at one time or download it in one
piece. That lets one modularize your documents without resorting to links.
One can single-source a section so that an edit to it is reflected everywhere
the section is used, and yet a document composed from such pieces looks
for all the world like a one-piece document.
Linkability
XML has great ability to define links between documents. This initiative lets
one define two-way links, multiple-target links, "expanding" links (where
clicking a link causes the targeted information to appear inline), and links
between two existing documents that are defined in a third.
58
Easily Processed
As mentioned earlier, regular and consistent notation makes it easier to
build a program to process XML data. For example, in HTML a <dt> tag
can be delimited by </dt>, another <dt>, <dd>, or </dl>. That makes for
some difficult programming. But in XML, the <dt> tag must always have a
</dt> terminator, or else it will be defined as a <dt/> tag. That restriction
is a critical part of the constraints that make an XML document wellformed. (Otherwise, the XML parser won't be able to read the data.) And
since XML is a vendor-neutral standard, one can choose among several
XML parsers, any one of which takes the work out of processing XML data.
Hierarchical
Finally, XML documents benefit from their hierarchical structure.
Hierarchical document structures are, in general, faster to access because
one can drill down to the part she need, like stepping through a table of
contents. They are also easier to rearrange, because each piece is delimited.
In a document, for example, one could move a heading to a new location
and drag everything under it along with the heading, instead of having to
page down to make a selection, cut, and then paste the selection into a new
location.
59
Introduction to XML
Each XML document has both a logical and a physical structure. Physically,
the document is composed of units called entities. An entity may refer to
other entities to cause their inclusion in the document. A document begins
in a "root" or document entity. Logically, the document is composed of
declarations, elements, comments, character references, and processing
instructions, all of which are indicated in the document by explicit markup.
A software module called an XML processor is used to read XML
documents and provide access to their content and structure. It is assumed
that an XML processor is doing its work on behalf of another module,
called the application. This specification describes the required behavior of
an XML processor in terms of how it must read XML data and the
information it must provide to the application.
XML is a text-based markup language that is fast becoming the standard for
data interchange on the Web. As with HTML, one identifies data using tags
(identifiers enclosed in angle brackets, like this: <...>). Collectively, the tags
are known as "markup".
But unlike HTML, XML tags identify the data, rather than specifying how to
display it. Where an HTML tag says something like "display this data in bold
font" (<b>...</b>), an XML tag acts like a field name in a program. It puts
a label on a piece of data that identifies it (for example:
<message>...</message>).
61
Identifies the character set used to encode the data. "ISO-8859-1" is "Latin1" the Western European and English language character set. (The default is
compressed Unicode: UTF-8.)
standalone
Tells whether or not this document references an external entity or an
external data type specification (see below). If there are no external
references, then "yes" is appropriate
The prolog can also contain definitions of entities (items that are inserted
when we reference them from within the document) and specifications that
tell which tags are valid in the document, both declared in a Document
Type Definition (DTD) that can be defined directly within the prolog, as
well as with pointers to external specification files.
Processing Instructions
An XML file can also contain processing instructions that give commands or
information to an application that is processing the XML data. Processing
instructions have the following format:
<?target instructions?>
where the target is the name of the application that is expected to do the
processing, and instructions is a string of characters that embodies the
information or commands for the application to process.
Since the instructions are application specific, an XML file could have
multiple processing instructions that tell different applications to do similar
things, though in different ways. The XML file for a slideshow, for example,
could have processing instructions that let the speaker specify a technical or
executive-level version of the presentation. If multiple presentation
programs were used, the program might need multiple versions of the
processing instructions (although it would be nicer if such applications
recognized standard instructions).
62
Basic Standards
SAX: Simple API for XML
We can also think of this standard as the "serial access" protocol for XML.
This is the fast-to-execute mechanism we would use to read and write XML
data in a server, for example. This is also called an event-driven protocol,
because the technique is to register the handler with a SAX parser, after
which the parser invokes your callback methods whenever it sees a new
XML tag (or encounters an error, or wants to tell us anything else).
63
Namespaces
The namespace standard lets one write an XML document that uses two or
more sets of XML tags in modular fashion. Suppose for example that we
have created an XML-based parts list that uses XML descriptions of parts
supplied by other manufacturers (online!). The "price" data supplied by the
subcomponents would be amounts we want to total up, while the "price"
data for the structure as a whole would be something we want to display.
The namespace specification defines mechanisms for qualifying the names
so as to eliminate ambiguity. That lets us write programs that use
information from other sources and do the right things with it.
Schema Standards
A DTD makes it possible to validate the structure of relatively simple XML
documents, but that's as far as it goes.
A DTD can't restrict the content of elements, and it can't specify complex
relationships. For example, it is impossible to specify with a DTD that a
<heading> for a <book> must have both a <title> and an <author>, while
a <heading> for a <chapter> only needs a <title>. In a DTD, once we
only get to specify the structure of the <heading> element one time. There
is no context-sensitivity.
XML Schema
A large, complex standard that has two parts. One part specifies structure
relationships. (This is the largest and most complex part.) The other part
specifies mechanisms for validating the content of XML elements by
specifying a (potentially very sophisticated) datatype for each element.
64
XML Linking
These specifications provide a variety of powerful linking mechanisms, and
are sure to have a big impact on how XML documents are used.
XLink: The XLink protocol is a proposed specification to handle links
between XML documents. This specification allows for some pretty
sophisticated linking, including two-way links, links to multiple documents,
"expanding" links that insert the linked information into your document
rather than replacing your document with a new page, links between two
documents that are created in a third, independent document, and indirect
links (so we can point to an "address book" rather than directly to the target
document -- updating the address book then automatically changes any links
that use it).
XML Base: This standard defines an attribute for XML documents that
defines a "base" address, that is used when evaluating a relative address
specified in the document. (So, for example, a simple file name would be
found in the base-address directory.)
XPointer: In general, the XLink specification targets a document or
document-segment using its ID. The XPointer specification defines
mechanisms for "addressing into the internal structures of XML
documents", without requiring the author of the document to have defined
an ID for that segment. To quote the spec, it provides for "reference to
elements, character strings, and other parts of XML documents, whether or
not they bear an explicit ID attribute".
<partorders xmlns="...">
<order date="..."
ref="...">
<desc> ..text..
</desc>
<part />
<quantity />
65
<delivery-date />
</order>
<order ref=".." .../>
</partorders>
ref=
date=
des
c
text
order
par
t
partorder
s
quantit
y
text
xmlns=
deliverydate
order
ref=
date=
The same approach is utilized to convert the data from the database into
adequate XML formatted text. An example for the sample conversion of
the data listing from our system is:
66
DateJoined Password
agupta
gupta
amber
india
2001-01password
01T00:00:00
apsingh
singh
abhay
USA
2001-01jabkjb
01T00:00:00
20
prats
kumar
pratyush
india
2001-04xfilesfan
22T10:48:19
29
pravi
tripathi
pravi
bombay [email protected]
2003-05ddf
06T17:25:16
This is the table generated with formatting option turned on. Data used is
sample data, just for testing purposes. Real data cannot be displayed due to
contractual terms.
67
69
Sequence Diagram:
Client App
Server App
Database
Open Connection
Table_List OK
Select Table
Select Table
XML Data
RecordSet
Data
Manipulation
Update
Update Table
OK
OK
Close Connection
Close Connection
70
The Client:
The design of the client was mainly to suit the immediate requirement of
the customer. The requirement was to have a sufficiently functional
prototype that could be used to view and alter data present in the remote
database. Due to the use of generic XML in the data interaction, the design
of the client application becomes easy and at the same time tough. The ease
is in the interpretation of the data received from the server, while the
difficulty is encountered when one wants to preserve the generality of the
interface. The interface constitutes an important aspect of the system.
Nothing can be hard coded. The interface has thus to be generated at
runtime, depending on the record-set present in the table. Depending upon
the rows and columns present, the client side must adapt itself to suit the
same.
The client application takes input from the user and passes it to the server
side for further processing. Initially the client requests the database through
asp for the list of tables available in it. Then the user may select any
particular primary id for further manipulation. He requests that particular id
through asp and database sends all the related table information of that
particular primaryID. The user may then perform various operations such
as add, delete, modify, update etc on the tables and send back the updated
record to the database.
The client designed at present works in two modes, manipulation mode and
display mode. While manipulation mode could be used for updating data
through a remote terminal, often dumb. Whereas, display mode is used to
passively display the data, formatted or unformatted, as the case may be.
Such system finds large applications in places where a central database is
used to generate formatted output on the web and which needs to be
updated remotely.
A scenario of client usage can be demonstrated as under:
DSN
UID
Passwd
ODBC
Database
Client Application
71
72
While the solution developed here conformed to the needs of the client, there are
indeed some enhancements that could be made in the solution to make it better
equipped to handle larger variety of scenarios.
At present, the system uses plain-text to exchange database username and
password between the client and server. This is indeed a security limitation, but
has been deliberately demanded by the client so as to facilitate easy integration
of the solution across differing applications, already developed. Any custom
encryption makes a need for code revamping to suit the needs. Future solutions
could implement additional modules to take care of encryption needs if so
desired.
73
Bibliography
www.microsoft.com
www.rpbourret.com/xml/XMLDatabaseProds.htm
www.netwind.com
www.mcmcse.com
www.certportal.com
www.microsnap.com
www.xmldb.org
www.softwareag.com/tamino/
www.xmldatabases.org
www.w3schools.com/xml/default.asp
www.htmlgoodies.com/tutors/xmldir.html
www.asp-database.de/aspdatabase/
www.tutorial-web.com/asp/database/
www.activeserverpages.com/database/
www.aspin.com/home/tutorial
www.activeserverpages.com/tutorials/
www.101-asp-tutorials.com
www.google.com
www.ucertify.com
ACM Special Interest Group on Mobile Computing and Communications (SIGMOBILE)
74