Wednesday, 9 March 2011


train_info.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rail_info SYSTEM "rail_info.dtd">
<?xml-stylesheet type="text/css" href="rail_info.css"?>
<rail_info>

<train_info>
<title1>Information about the trains</title1>

<train>
<type>SuperFast</type>
<name>GaribRath</name>
<no>12495</no>
<source>Delhi</source>
<dest>Patna</dest>
</train>
</train_info>

<station_info>
<title2>Information about the station</title2>
<station>
<name>Patna</name>
<code>pnbe</code>
<zone>North East</zone>
<no_train_stop>50</no_train_stop>
<no_train_pass>50</no_train_pass>
</station>
</station_info>

<zone_info>
<title2>Information about the zone</title2>
<zone>
<name>North East</name>
<code>ne</code>
<no_of_st>100</no_of_st>
</zone>
</zone_info>

</rail_info>


train_info.dtd
<!ELEMENT rail_info (train_info,station_info,zone_info)>
<!ELEMENT train_info (title1,train+)>
<!ELEMENT train (type,name,no,source,dest)>
<!ELEMENT station_info (title2,station+)>
<!ELEMENT station (name,code,zone,no_train_stop,no_train_pass)>
<!ELEMENT zone_info (title3,zone+)>
<!ELEMENT zone (name,code,no_of_st)>
<!ELEMENT type (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT no (#PCDATA)>
<!ELEMENT source (#PCDATA)>
<!ELEMENT dest (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT code (#PCDATA)>
<!ELEMENT zone (#PCDATA)>
<!ELEMENT no_train_stop (#PCDATA)>
<!ELEMENT no_train_pass (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT code (#PCDATA)>
<!ELEMENT zone (#PCDATA)>

rail_info.css

rail_info
{
background-color: #ffffff;
width: 100%;
}
train_info,station_info,zone_info,train,station,zone
{
display: block;
margin-bottom: 30pt;
margin-left: 0;
}
title1,title2,title3
{
color: #FF0000;
font-size: 20pt;
}
type,name
{
color: #0000FF;
font-size: 20pt;
}
code,no,source,dest,zone,no_train_stop,no_train_pass,code,no_of_st
{
display: block;
color: #ff0;
margin-left: 20pt;
}

XML AND DTD(news.xml)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE NEWSPAPER [

<!ELEMENT NEWSPAPER (ARTICLE+)>
<!ELEMENT ARTICLE (HEADLINE,BYLINE,LEAD,BODY,NOTES)>
<!ELEMENT HEADLINE (#PCDATA)>
<!ELEMENT BYLINE (#PCDATA)>
<!ELEMENT LEAD (#PCDATA)>
<!ELEMENT BODY (#PCDATA)>
<!ELEMENT NOTES (#PCDATA)>

<!ATTLIST ARTICLE AUTHOR CDATA #REQUIRED>
<!ATTLIST ARTICLE EDITOR CDATA #IMPLIED>
<!ATTLIST ARTICLE DATE CDATA #REQUIRED>
<!ATTLIST ARTICLE EDITION CDATA #IMPLIED>

<!ENTITY NEWSPAPER "Vervet Logic Times">
<!ENTITY PUBLISHER "Vervet Logic Press">
<!ENTITY COPYRIGHT "Copyright 1998 Vervet Logic Press">

]>
<NEWSPAPER>
<ARTICLE AUTHOR="Ravi" EDITOR="Tom" DATE="5/2/11" EDITION="vol32">
<HEADLINE>INDIA WINS THE MATCH</HEADLINE>
<BYLINE>&PUBLISHER;</BYLINE>
<LEAD>ANUJ &NEWSPAPER;</LEAD>
<BODY>INDIA BEAT DUTCH</BODY>
<NOTES>&COPYRIGHT;</NOTES>
</ARTICLE>
<ARTICLE AUTHOR="Eric" EDITOR="Robert" DATE="8/2/11" EDITION="vol39">
<HEADLINE>ARSNEL Beat MANU</HEADLINE>
<BYLINE>&PUBLISHER;  </BYLINE>
<LEAD>ANUJ &NEWSPAPER;Eric Donald</LEAD>
<BODY>INDIA BEAT DUTCH</BODY>
<NOTES>&COPYRIGHT;</NOTES>
</ARTICLE>
<ARTICLE AUTHOR="ROss" DATE="24/2/11">
<HEADLINE>Nickel back new album </HEADLINE>
<BYLINE>&PUBLISHER; </BYLINE>
<LEAD>ANUJ &NEWSPAPER;Kyra  Jhonson</LEAD>
<BODY>Someday Hit song</BODY>
<NOTES>&COPYRIGHT;</NOTES>
</ARTICLE>
</NEWSPAPER>



INLINE declaration of DTD with in XML document

Tuesday, 8 March 2011

EXE 7.1, 7.2

cars.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cars SYSTEM "cars.dtd">

<cars>
    <car>
        <make> suzuki </make>
        <model> swift </model>
        <year> 2010 </year>
        <color> white </color>
        <engine>
               <no_of_cylinder> 4 </no_of_cylinder>
               <fuel_system> diesel </fuel_system>
        </engine>
                <no_of_doors> 4 </no_of_doors>
        <transmission_type> paddle shift </transmission_type>
        <accessories  radio="no"
                     air_conditioning="no"
                     power_windows="no"
                     power_steering="yes"
                     power_brakes="yes">accessories </accessories>
      </car>
       <car>
        <make> honda </make>
        <model> honda city </model>
        <year> 2008 </year>
        <color> red </color>
        <engine>
               <no_of_cylinder> 4 </no_of_cylinder>
               <fuel_system> petrol </fuel_system>
        </engine>
        <no_of_doors> 4 </no_of_doors>
        <transmission_type> tiptronic </transmission_type>
        <accessories  radio="yes"
                            air_conditioning="no"
                     power_windows="yes"
                     power_steering="no"
                     power_brakes="yes">accessories </accessories>
      </car>
 </cars>

cars.dtd

<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT cars(car+)>
<!ELEMENT car(make,model,year,color,engine,no_of_doors,transmission_type,accessories)>
<!ELEMENT make(#PCDATA)>
<!ELEMENT model(#PCDATA)>
<!ELEMENT year(#PCDATA)>
<!ELEMENT color(#PCDATA)>
<!ELEMENT engine(no_of_cylinders,fuel_systems)>
<!ELEMENT no_of_cylinders(#PCDATA)>
<!ELEMENT fuel_systems(#PCDATA)>
<!ELEMENT no_of_doors(#PCDATA)>
<!ELEMENT transmission_type(#PCDATA)>
<!ELEMENT accessories(#PCDATA)>
<!ATTLIST accessories radio CDATA #REQUIRED>
<!ATTLIST accessories air_conditioning CDATA #REQUIRED>
<!ATTLIST accessories power_windows CDATA #REQUIRED>
<!ATTLIST accessories power_steering CDATA #REQUIRED>
<!ATTLIST accessories power_brakes CDATA #REQUIRED>


Ex 7.2 DTD document for car catalog

<?xml version = "1.0" encoding = "utf-8"?>
<!ELEMENT cars(ad+)>
<!ELEMENT ad(make,model,year,color,engine,number_of_doors,transmission_type,accessories)>
<!ELEMENT make(# PCDATA)>
<!ELEMENT model(#PCDATA)>
<!ELEMENT year(#PCDATA)>
<!ELEMENT color(#PCDATA)>
<!ELEMENT engine(number_of_cylinders,fuel_system)>
<!ELEMENT number_of_doors(#PCDATA)>
<!ELEMENT transmission_type(#PCDATA)>
<!ELEMENT accessories(#PCDATA)>

<!ATTLIST accessories radio CDATA #IMPLIED>
<!ATTLIST accessories air_conditioner CDATA #IMPLIED>
<!ATTLIST accessories power_window CDATA #REQUIRED>
<!ATTLIST accessories power_steering CDATA #REQUIRED>
<!ATTLIST accessories power_brake CDATA #REQUIRED>

Ex 7.1 xml document

<?xml version = "1.0" encoding = "Utf-8"?>
<!DOCTYPE cars SYSTEM "cars.dtd">
<cars>
 <ad>
   <make>Toyoto</make>
   <model>Corolla</model>
   <year>2000</year>
   <color>black</color>
   <engine>
        <number_of_cylinders>2</number_of_cylinders>
        <fuel_system>4 stroke petrol</fuel_system>
   </engine>
   <number_of_doors>4</number_of_doors>
   <transmission_type>continously variable</transmission_type>
  
   <accessories radio = "yes"
                air_conditioner = "yes"
                power_window = "no"
                power_steering = "no"
                power_brake = "no">accessories </accessories>
 </ad>

 <ad>
   <make>Cheverlet</make>
   <model>Tavera</model>
   <year>2000</year>
   <color>red</color>
   <engine>
        <number_of_cylinders>4</number_of_cylinders>
        <fuel_system>4 stroke diesel</fuel_system>
   </engine>
   <number_of_doors>4</number_of_doors>
   <transmission_type>dual clutch</transmission_type>
  
   <accessories radio = "yes"
                air_conditioner = "yes"
                power_window = "yes"
                power_steering = "no"
                power_brake = "no">accessories</accessories>
 </ad>
</cars>

Sunday, 6 March 2011

MASH-UP !!!

First of all, i would like to explain the term MASHUP means mixing or remix, here it is a combination of tools or we can say data from other sources or web pages. Mash-ups collect data from multiple web pages and collect required information into one web application. In simple words , A web mash-up is a web application that collect information from one or more sources and provide information in a unique layout . There are number of ways for mash-ups to use in required manner and mash-ups are like endless.

To create a mash-up, many different sources are required and usually that sources have an XML based module for make compatibility to provide data for mash-ups. This allows the mash-up to use these XML outputs as inputs. Once the required data got collected and combined , the mash-up will generate its own output after manipulate them, which displays a combination of the original data from other sources.

In Web development, a mashup is a Web page or application that uses and combines data, and to create new services it uses functions and way of presentation from other sources. The main characteristics of the mashups are combination, visualization, and aggregation.

In the past years, number of Web applications have published application programming interfaces that enable developers to integrate data and functions easily , in place of building them by themselves. We can say that Mashups played an active role for evolution of social software and Web 2.0. Generally mashup do not require programming skills and support services .

There are many types of mashups, such as

  • Business mashups
  • Consumer mashups
  • Data mashups

Mashups are a field of interactive Web applications that based upon content retrieved from external data sources to create new and innovative services. This blog explores what it means to be a mashup, the different classes of mashups and their applications already constructed today.

Wednesday, 2 March 2011

Evolution of SOA

Earlier programmers find it difficult to write more complex programs so they required a better way to reuse the code than rewriting so they opted modular design but they needed higher level of abstraction so object oriented design was evolved. Component-based software was a good solution for reuse and maintenance, but it doesn't address all of the complexities  faced by developers.

SOA  provides a solution to all of the above by eliminating the problems of protocol, platforms and integrated applications.

The key components of SOA are:

Services
Messages
Dynamic discovery
Web services


 SOA, in combination with web services reduces complexity. Application integration is one of the major issues companies face today SOA can solve  System availability, reliability, and scalability.