Iwd Unit 5
Iwd Unit 5
UNIT 5
Shalini Shukla
XML INTRODUCTION
XML (Extensible Markup Language) is a markup language
similar to HTML, but without predefined tags to use.
Instead, you define your own tags designed specifically for your
needs.
This is a powerful way to store data in a format that can be
stored, searched, and shared.
Most importantly, since the fundamental format of XML is
standardized, if you share or transmit XML across systems or
platforms, either locally or over the internet, the recipient can still
parse the data due to the standardized XML syntax.
Structure of an XML document
XML declaration
XML - declaration is not a tag. It is used for the transmission of
the meta-data of a document.
<?xml version="1.0" encoding="UTF-8"?>
FEATURES OF XML
Xml (eXtensible Markup Language) is a mark up language.
XML is designed to store and transport data.
XML tags are not predefined. You must define your own tags.
property of CSS.
Identify the titles and bold them.
Linking XML with CSS :
In order to display the XML file using CSS, link XML file with CSS.
Below is the syntax for linking the XML file with CSS:
<?xml-stylesheet type="text/css"
href="name_of_css_file.css"?>
XML file :
<?xml version="1.0" encoding="UTF-8"?> <book>
<?xml-stylesheet type="text/css" href="Rule.css"?> <title>Title -: Computer Networks</title>
<author>Author -: Foruouzan</author>
<books> <publisher>Publisher -: Mc Graw
<heading>Welcome To XML </heading> Hill</publisher>
<book> <edition>Edition -: 5</edition>
<price>Price -: 700</price>
<title>Title -: Web Programming</title> </book>
<author>Author -: abc</author> <book>
<title>Title -: DBMS Concepts</title>
<publisher>Publisher -: Wiley</publisher>
<author>Author -: Navath</author>
<edition>Edition -: 3</edition> <publisher>Publisher -: Oxford</publisher>
<price> Price -: 300</price> <edition>Edition -: 5</edition>
<price>Price -: 600</price>
</book>
</book>
<book> <book>
<title>Title -: Internet world-wide-web</title> <title>Title -: Linux Programming</title>
<author>Author -: Subhitab Das</author>
<author>Author -: Ditel</author> <publisher>Publisher -: Oxford</publisher>
<publisher>Publisher -: Pearson</publisher> <edition>Edition -: 8</edition>
<edition>Edition -: 3</edition> <price>Price -: 300</price>
</book>
<price>Price -: 400</price> </books>
</book>
CSS FILE :
Creating Rule.css as:-
books {
color: white;
background-color : gray;
width: 100%;
}
heading {
color: green;
font-size : 40px;
background-color : powderblue;
}
heading, title, author, publisher, edition, price {
display : block;
}
title {
font-size : 25px;
font-weight : bold;
}
DATA INTERCHANGE USING XML
DOCUMENT
Data in XML markup language can easily be integrated with
other software components that support XML.
This means that if you can get suitable data out of one
application in XML format, you can usually use a translator
tool (such as XSLT) to transform it into a form suitable for the
destination application.
XML DTD
What is DTD
DTD stands for Document Type Definition.
Syntax:
Clients does not know what methods to call, they just overrides the
methods of the API and place his own code inside method.
It is an event based parser, it works like an event handler in Java.
Advantages
1) It is simple and memory efficient.
XML DOM
DOM is an acronym stands for Document Object Model. It defines a
standard way to access and manipulate documents.
The Document Object Model (DOM) is a programming API(Application
programming interface) for HTML and XML documents.
It defines the logical structure of documents and the way a document is
accessed and manipulated.
As a W3C specification, one important objective for the Document Object
Model is to provide a standard programming interface that can be used in a
wide variety of environments and applications.
The Document Object Model can be used with any programming language.
The elements, their content (text and attributes) are all known
as nodes.
XML can be used to store and arrange the data, which can
customize your data handling needs.
XML can easily be merged with style sheets to create
almost any desired output.
Virtually, any type of data can be expressed as an XML
document.
XML ON THE SERVER
XML files are plain text files just like HTML files.
XML can easily be stored and generated by a standard web
server.
Storing XML Files on the Server
XML files can be stored on an Internet server exactly the same
way as HTML files.
<?xml version="1.0" encoding="UTF-8"?>
<note>
<from>Jani</from>
<to>Tove</to>
<message>Remember me this weekend</message>
</note>
GENERATING XML WITH PHP
<?php
header("Content-type: text/xml");
echo "<?xml version='1.0' encoding='UTF-8'?>";
echo "<note>";
echo "<from>Jani</from>";
echo "<to>Tove</to>";
echo "<message>Remember me this weekend</message>";
echo "</note>";
?>
COMMON GATEWAY INTERFACE (CGI)
The Common Gateway Interface (CGI) provides the
middleware between WWW servers and external databases and
information sources.
It writes and transmits (marshals) the parameters to the remote Virtual Machine
(JVM),
It waits for the result
It is the basis upon which OLE and ActiveX are built, and it
allows code to be reused without being recompiled.
This tutorial will teach you how to use VBScript in your day-
to-day life of any Web-based or automation project
development.
YOUR FIRST VBSCRIPT
Let us write a VBScript to print out "Hello World".
<html>
<body> <script language = "vbscript" type = "text/vbscript">
document.write("Hello World!")
</script>
</body>
</html>
In the above example, we called a function document.write,
which writes a string into the HTML document. This function
can be used to write text, HTML or both.
SINGLE LINE SYNTAX