SlideShare a Scribd company logo
Unit 4
What is xml
• Xml (eXtensible Markup Language) is a mark up
language.
• XML is designed to store and transport data.
• Xml was released in late 90’s. it was created to provide
an easy to use and store self describing data.
• XML became a W3C Recommendation on February 10,
1998.
• XML is not a replacement for HTML.
• XML is designed to be self-descriptive.
• XML is designed to carry data, not to display data.
• XML tags are not predefined. You must define your
own tags.
• XML is platform independent and language
independent.
What is mark-up language
• A mark up language is a modern system for
highlight or underline a document.
• Students often underline or highlight a
passage to revise easily, same in the sense of
modern mark up language highlighting or
underlining is replaced by tags.
Features and Advantages of XML
• XML is widely used in the era of web
development.
• It is also used to simplify data storage and
data sharing.
• The main features or advantages of XML are
given below.
1) XML separates data from HTML
• If you need to display dynamic data in your HTML
document, it will take a lot of work to edit the
HTML each time the data changes
• With XML, data can be stored in separate XML
files.
• This way you can focus on using HTML/CSS for
display and layout, and be sure that changes in
the underlying data will not require any changes
to the HTML.
• With a few lines of JavaScript code, you can read
an external XML file and update the data
content of your web page.
2) XML simplifies data sharing
• In the real world, computer systems and
databases contain data in incompatible
formats.
• XML data is stored in plain text format.
• This provides a software- and hardware-
independent way of storing data.
• This makes it much easier to create data that
can be shared by different applications.
3) XML simplifies data transport
• One of the most time-consuming challenges
for developers is to exchange data between
incompatible systems over the Internet.
• Exchanging data as XML greatly reduces this
complexity, since the data can be read by
different incompatible applications.
4) XML simplifies Platform change
• Upgrading to new systems (hardware or
software platforms), is always time
consuming.
• Large amounts of data must be converted and
incompatible data is often lost.
• XML data is stored in text format.
• This makes it easier to expand or upgrade to
new operating systems, new applications, or
new browsers, without losing data.
5) XML increases data availability
• Different applications can access your data,
not only in HTML pages, but also from XML
data sources.
• With XML, your data can be available to all
kinds of "reading machines" (Handheld
computers, voice machines, news feeds, etc),
and make it more available for blind people,
or people with other disabilities.
XML Example
• XML documents create a hierarchical structure
looks like a tree so it is known as XML Tree
that starts at "the root" and branches to "the
leaves".
Example of XML Document
• XML documents uses a self-describing and
simple syntax:
• The first line is the XML declaration.
• It defines the XML version (1.0) and the
encoding used (ISO-8859-1 = Latin-1/West
European character set).
• The next line describes the root element of
the document (like saying: "this document is a
note"):
• The next 4 lines describe 4 child elements of
the root (to, from, heading, and body).
• And finally the last line defines the end of the
root element.
• XML documents must contain a root element.
• This element is "the parent" of all other
elements.
• The elements in an XML document form a
document tree.
• The tree starts at the root and branches to the
lowest level of the tree.
• All elements can have sub elements (child
elements).
• The terms parent, child, and sibling are used
to describe the relationships between
elements.
• Parent elements have children.
• Children on the same level are called siblings
(brothers or sisters).
• All elements can have text content and
attributes (just like in HTML).
Another Example of XML: Books
• File: books.xml
• The root element in the example is
<bookstore>.
• All elements in the document are contained
within <bookstore>.
• The <book> element has 4 children: <title>,<
author>, <year> and <price>.
XML Attributes
• XML elements can have attributes.
• By the use of attributes we can add the
information about the element.
• XML attributes enhance the properties of the
elements.
• Let us take an example of a book publisher.
Here, book is the element and publisher is the
attribute.
• <book publisher="Tata McGraw Hill"></book>
<book publisher='Tata McGraw Hill'></book>
• In the first example, gender is an attribute. In
the last example, gender is an element.
• Both examples provide the same information.
• There are no rules about when to use
attributes or when to use elements in XML
The id attributes above are for identifying the
different notes. It is not a part of the note
itself.
What I'm trying to say here is that metadata
(data about data) should be stored as
attributes, and the data itself should be stored
as elements.
XML Naming Rules
• XML elements must follow these naming rules:
1. Element names are case-sensitive
2. Element names must start with a letter or
underscore
3. Element names cannot start with the letters xml
(or XML, or Xml, etc)
4. Element names can contain letters, digits,
hyphens, underscores, and periods
5. Element names cannot contain spaces
6. Any name can be used, no words are reserved
(except xml).
XML DTD
• What is DTD
• DTD stands for Document Type Definition.
• It defines the legal building blocks of an XML
document.
• It is used to define document structure with a
list of legal elements and attributes.
Purpose of DTD
• Its main purpose is to define the structure of
an XML document.
• It contains a list of legal elements and define
the structure with the help of them.
DTD - XML Building Blocks
• The main building blocks of both XML and
HTML documents are elements.
The Building Blocks of XML
Documents
• Seen from a DTD point of view, all XML
documents are made up by the following
building blocks:
• Elements
• Attributes
• Entities
• PCDATA
• CDATA
Elements
• Elements are the main building blocks of both
XML and HTML documents.
• Examples of HTML elements are "body" and
"table".
• Examples of XML elements could be "note"
and "message".
• Elements can contain text, other elements, or
be empty.
• Examples of empty HTML elements are "hr",
"br" and "img".
• Examples:
DTD - Elements
• In a DTD, elements are declared with an
ELEMENT declaration.
Elements with Parsed Character Data
• Elements with only parsed character data are
declared with #PCDATA inside parentheses:
Attributes
• Attributes provide extra information about
elements.
• Attributes are always placed inside the
opening tag of an element.
• Attributes always come in name/value pairs.
• The following "img" element has additional
information about a source file:
Entities
• Some characters have a special meaning in
XML, like the less than sign (<) that defines the
start of an XML tag.
• Most of you know the HTML entity: "&nbsp;".
This "no-breaking-space" entity is used in
HTML to insert an extra space in a document.
Entities are expanded when a document is
parsed by an XML parser.
• The following entities are predefined in XML:
Note: An entity has three parts: an ampersand
(&), an entity name, and a semicolon (;).
PCDATA
• PCDATA means parsed character data.
• Think of character data as the text found
between the start tag and the end tag of an XML
element.
• PCDATA is text that WILL be parsed by a
parser. The text will be examined by the parser
for entities and markup.
• Tags inside the text will be treated as markup and
entities will be expanded.
• However, parsed character data should not
contain any &, <, or > characters; these need to
be represented by the &amp; &lt; and &gt;
entities, respectively.
CDATA
• CDATA means character data.
• CDATA is text that will NOT be parsed by a parser.
• Tags inside the text will NOT be treated as markup and
entities will not be expanded.
• In this chapter, we will discuss XML CDATA section.
• The term CDATA means, Character Data. CDATA is
defined as blocks of text that are not parsed by the
parser, but are otherwise recognized as markup.
• The predefined entities such as &lt;,
&gt;, and &amp; require typing and are generally
difficult to read in the markup. In such cases, CDATA
section can be used.
• By using CDATA section, you are commanding the
parser that the particular section of the document
contains no markup and should be treated as regular
text.
employee.xml
• In the above example, the DOCTYPE
declaration refers to an external DTD file.
• The content of the file is shown in below
paragraph.
employee.dtd
Description of DTD
• <!DOCTYPE employee : It defines that the root
element of the document is employee.
• <!ELEMENT employee: It defines that the
employee element contains 3 elements
"firstname, lastname and email".
• <!ELEMENT firstname: It defines that the
firstname element is #PCDATA typed. (parse-able
data type).
• <!ELEMENT lastname: It defines that the
lastname element is #PCDATA typed. (parse-able
data type).
• <!ELEMENT email: It defines that the email
element is #PCDATA typed. (parse-able data
type).
Internal DTD
• A DTD is referred to as an internal DTD if
elements are declared within the XML files.
• To reference it as internal
DTD, standalone attribute in XML declaration
must be set to yes.
• This means the declaration works
independent of external source.
External DTD
• In external DTD elements are declared outside
the XML file.
• They are accessed by specifying the system
attributes which may be either the
legal .dtd file or a valid URL.
• To reference it as external
DTD, standalone attribute in the XML
declaration must be set as no.
• This means, declaration includes information
from the external source.
Example 2
Student.html
Student.xml
Output
XML DTD with entity declaration
• A doctype declaration can also define special
strings that can be used in the XML file.
An entity has three parts:
1. An ampersand (&)
2. An entity name
3. A semicolon (;)
Syntax to declare entity:
Let's see a code to define the ENTITY in doctype
declaration.
author.xml
In the previous example, sj is an entity that is used inside the
author element.
In such case, it will print the value of sj entity that is "Sonoo
Jaiswal".
Checking Validation
• Before proceeding with XML DTD, you must
check the validation.
• An XML document is called "well-formed" if it
contains the correct syntax.
• A well-formed and valid XML document is one
which have been validated against DTD.
• Visit http://www.xmlvalidation.com to
validate the XML file.
Valid and well-formed XML document
with DTD
• Let's take an example of well-formed and valid
XML document.
• It follows all the rules of DTD.
HTML vs XML
• There are many differences between HTML
(Hyper Text Markup Language) and XML
(eXtensible Markup Language).
• The important differences are given below:
XML Parsers
• An XML parser is a software library or package
that provides interfaces for client applications
to work with an XML document.
• The XML Parser is designed to read the XML
and create a way for programs to use XML.
• XML parser validates the document and check
that the document is well formatted.
• Let's understand the working of XML parser by
the figure given below:
Parsing a Text String
• This example parses a text string into an XML
DOM object, and extracts the info from it with
JavaScript:
Sending an XMLHttpRequest
• A common JavaScript syntax for using the
XMLHttpRequest object looks much like this:
Types of XML Parsers
• These are the two main types of XML Parsers:
1. DOM
2. SAX
DOM (Document Object Model)
• A DOM document is an object which contains
all the information of an XML document.
• It is composed like a tree structure.
• The DOM Parser implements a DOM API.
• This API is very simple to use.
Features of DOM Parser
• A DOM Parser creates an internal structure in
memory which is a DOM document object and
the client applications get information of the
original XML document by invoking methods
on this document object.
• DOM Parser has a tree based structure.
• Advantages
1) It supports both read and write operations
and the API is very simple to use.
2) It is preferred when random access to widely
separated parts of a document is required.
• Disadvantages
1) It is memory inefficient. (consumes more
memory because the whole XML document
needs to loaded into memory).
2) It is comparatively slower than other parsers.
SAX (Simple API for XML)
• A SAX Parser implements SAX API.
• This API is an event based API and less
intuitive.
Features of SAX Parser
• It does not create any internal structure.
• 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.
2) It is very fast and works for huge documents.
• Disadvantages
1) It is event-based so its API is less intuitive.
2) Clients never know the full information
because the data is broken into pieces.
What is 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
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.
• XML DOM defines a standard way to access and
manipulate XML documents.
The XML DOM
• All XML elements can be accessed through the
XML DOM.
XML DOM Nodes
• According to the XML DOM, everything in an
XML document is a node:
• The entire document is a document node
• Every XML element is an element node
• The text in the XML elements are text nodes
• Every attribute is an attribute node
• Comments are comment nodes
The XML DOM Node Tree
• The XML DOM views an XML document as a
tree-structure. The tree structure is called
a node-tree.
• All nodes can be accessed through the tree.
Their contents can be modified or deleted,
and new elements can be created.
• The node tree shows the set of nodes, and the
connections between them. The tree starts at
the root node and branches out to the text
nodes at the lowest level of the tree:
• Because the XML data is structured in a tree
form, it can be traversed without knowing the
exact structure of the tree and without
knowing the type of data contained within.
XML DOM - Accessing Nodes
• With the DOM, you can access every node in
an XML document.
• Note that the example above only returns
<title> elements under the x node.
• To return all <title> elements in the XML
document use:
DOM Node List Length
• The length property defines the length of a
node list (the number of nodes).
• You can loop through a node list by using the
length property:
XML DOM Example : Load XML File
• Let's take an example to show how an XML
document ("note.xml") is parsed into an XML
DOM object.
• This example parses an XML document
(note.xml) into an XML DOM object and
extracts information from it with JavaScript.
• Let's see the XML file that contains message.
note.xml
Let's see the HTML file that extracts
the data of XML document using
DOM.
xmldom.html
XML DOM Traverse Node Tree
• Traversing means looping through or traveling
across the node tree.
Traversing the Node Tree
• Often you want to loop an XML document, for
example: when you want to extract the value
of each element.
• This is called "Traversing the node tree"
• The example below loops through all child
nodes of <book>, and displays their names
and values:
Example explained:
Load the XML string into xmlDoc
Get the child nodes of the root element
For each child node, output the node name
and the node value of the text node
Websites Hosting
• Web hosting is a service of providing online space for
storage of web pages.
• These web pages are made available via World Wide Web.
• The companies which offer website hosting are known
as Web hosts.
• The servers on which web site is hosted remain switched
on 24 x7.
• These servers are run by web hosting companies.
• Each server has its own IP address.
• Since IP addresses are difficult to remember therefore,
webmaster points their domain name to the IP address of
the server their website is stored on.
• It is not possible to host your website on your local
computer, to do so you would have to leave your computer
on 24 hours a day.
• This is not practical and cheaper as well.
• This is where web hosting companies comes in.
Types of Web Hosting
• Web Hosting is a service that allows hosting/post web-
server applications( website or web page ) on a
computer system through which web-browser client
can have easy access to electronic content on the
Internet.
• Web Server or Web Host is a computer system that
provide web hosting. When Internet user’s want to
view your website, all they need to do is type your
website address or domain into their browser. The
user’s computer will then connect to your server and
your web pages will be delivered to them through the
browser. Basically, the web hosts allows the customers
to place documents, such as html pages, graphics, and
other multimedia files etc. onto a special type of
computer called a web server. It provides constant and
high speed connection to the backbone of Internet.
Different types of Web hosting
services are listed below:
• Free Hosting
• Virtual or Shared Hosting
• Dedicated Hosting
• Co-location Hosting
1. Free Hosting :
This is a free non-paid web hosting service. This
type of hosting is available with many prominent
sites that offer to host some web pages for no
cost.
Advantages :
• Free of cost
• Use websites to place advertisements.
banners and other forms of advertising media
Disadvantages:
• Customer support is missing
• Low bandwidth and lesser data transfer
• No control over your website
• 2. Shared/Virtual Hosting :
Its a web hosting service where many website
reside on one web server connected to the
internet. This type of hosting is provided under
one’s own domain name, www.yourname.com.
• With a hosting plan with the wed b hosting
company, one can present oneself as a fully
independent identity to his/her web audience.
Advantages :
• Easy and affordable
• Secured by hosting provider
• 24/7 Technical support
Disadvantages:
• Shared resources can slow down the whole
server
• Less flexible than dedicated hosting
• 3. Dedicated Hosting :
Hosted on a dedicated server, this type of hosting is
best suited for large websites with high traffic. In this,
the company wishing to go online, rents an entire web
server from a hosting company. This is suitable for
companies hosting larger websites, maintaining other’s
sites or managing a big online mall etc.
Advantages :
• Ideal for large business
• Strong database support
• Unlimited software support
• Powerful e-mail solutions
• Complete root access to your servers
Disadvantages:
• Its very expensive
• Requires superior skill sets
• 4. Co-located Hosting :
This hosting lets you place your own web server
on the premises of a service provider.
• It is similar to that of dedicated hosting except for
the fact that the server is now provided by the
user-company itself and its physical needs are
met by the hosting company.
Advantages :
• Greater Bandwidth High Up-Time
• Unlimited Software Options
• High Security
Disadvantages:
• Difficult to configure and debug
• Its expensive
• Require high skills
Web Hosting Companies
Websites Publishing
• Website publishing is the process of uploading
content on the internet. It includes:
• uploading files
• updating web pages
• posting blogs
Prerequisites for Website Publishing
• In order to publish your site, you need the
following things:
• Web development software
• Internet Connection
• Web Server
Web development software
• It is used for building web pages for your web
site. Dreamweaver and WordPress are
example of web development softwares.
Internet Connection
• Internet connection is required to connect to a
remotely located web server.
Web Server
• Web server is the actual location where your
website resides on. A web server may host
single or multiple sites depending on what
hosting service you have paid for.
Adobe Dreamweaver
• Adobe Dreamweaver is a software for designing web
pages.
• These HTML web pages are fully featured.
• This software provides a WYSIWYG i.e., What You See
Is What You Get interface for creating and editing the
web pages.
• The Adobe Dreamweaver software supports many
markup languages like HTML, XML, CSS, and JavaScript.
• It supports English, Spanish, French, German, Japanese,
Chinese, etc....
• The Dreamweaver was developed by Macromedia, and
it was published in 1997.
• In 2005 the Adobe had purchased Dreamweaver and
name it as Adobe Dreamweaver
Features of Adobe Dreamweaver
• 1. Fast, flexible coding.
• Creating, coding, and managing the websites
becomes very easy because of the simplified
coding engine. Using this software, HTML, CSS,
and other web standards can be quickly learned.
It speeds up the development of the web site.
• 2. Setup to site up in fewer steps.
• It becomes very easy to set up a web site, and
starter templates can be run very fast. Templates
can be customized for email, About pages, blogs,
e-commerce pages, newsletters, and portfolios.
For reading codes, code coloring and visual hints
can be used for quickly editing and updating.
• 3. Dynamic display on every device.
• Using Adobe Dreamweaver responsive
websites can build that can be fit into any
screen size. This helps in previewing sites and
editing makes sure that the page looks and
works the same way that you want.

More Related Content

Similar to Web Technology Part 4

01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
Baskarkncet
 
Xml basics
Xml basicsXml basics
Xml basics
Kumar
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
Swati Parmar
 
Xml iet 2015
Xml iet 2015Xml iet 2015
Xml iet 2015
kiransurariya
 
02 well formed and valid documents
02 well formed and valid documents02 well formed and valid documents
02 well formed and valid documents
Baskarkncet
 
Xml 1
Xml 1Xml 1
Xml intro1
Xml intro1Xml intro1
II UNIT PPT NOTES.pdf this is the data structures
II UNIT PPT NOTES.pdf this is the data structuresII UNIT PPT NOTES.pdf this is the data structures
II UNIT PPT NOTES.pdf this is the data structures
PriyankaRamavath3
 
xml.pptx
xml.pptxxml.pptx
xml.pptx
TilakaRt
 
Introduction to XML.ppt
Introduction to XML.pptIntroduction to XML.ppt
Introduction to XML.ppt
Varsha Uchagaonkar
 
Introduction to XML.ppt
Introduction to XML.pptIntroduction to XML.ppt
Introduction to XML.ppt
Varsha Uchagaonkar
 
Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
Jaya Kumari
 
Unit 5 xml (1)
Unit 5   xml (1)Unit 5   xml (1)
Unit 5 xml (1)
manochitra10
 
BITM3730 10-31.pptx
BITM3730 10-31.pptxBITM3730 10-31.pptx
BITM3730 10-31.pptx
MattMarino13
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
Pradeep Rapolu
 

Similar to Web Technology Part 4 (20)

XML
XMLXML
XML
 
01 xml document structure
01 xml document structure01 xml document structure
01 xml document structure
 
Xml passing in java
Xml passing in javaXml passing in java
Xml passing in java
 
Xml basics
Xml basicsXml basics
Xml basics
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
Xml iet 2015
Xml iet 2015Xml iet 2015
Xml iet 2015
 
Xml
XmlXml
Xml
 
Ch2 neworder
Ch2 neworderCh2 neworder
Ch2 neworder
 
02 well formed and valid documents
02 well formed and valid documents02 well formed and valid documents
02 well formed and valid documents
 
Xml 1
Xml 1Xml 1
Xml 1
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
XML
XMLXML
XML
 
II UNIT PPT NOTES.pdf this is the data structures
II UNIT PPT NOTES.pdf this is the data structuresII UNIT PPT NOTES.pdf this is the data structures
II UNIT PPT NOTES.pdf this is the data structures
 
xml.pptx
xml.pptxxml.pptx
xml.pptx
 
Introduction to XML.ppt
Introduction to XML.pptIntroduction to XML.ppt
Introduction to XML.ppt
 
Introduction to XML.ppt
Introduction to XML.pptIntroduction to XML.ppt
Introduction to XML.ppt
 
Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
 
Unit 5 xml (1)
Unit 5   xml (1)Unit 5   xml (1)
Unit 5 xml (1)
 
BITM3730 10-31.pptx
BITM3730 10-31.pptxBITM3730 10-31.pptx
BITM3730 10-31.pptx
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 

More from Thapar Institute

Digital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptxDigital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptx
Thapar Institute
 
Digital Electronics Unit_3.pptx
Digital Electronics Unit_3.pptxDigital Electronics Unit_3.pptx
Digital Electronics Unit_3.pptx
Thapar Institute
 
Digital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptxDigital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptx
Thapar Institute
 
Digital Electronics Unit_1.pptx
Digital Electronics Unit_1.pptxDigital Electronics Unit_1.pptx
Digital Electronics Unit_1.pptx
Thapar Institute
 
C Language Part 1
C Language Part 1C Language Part 1
C Language Part 1
Thapar Institute
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction
Thapar Institute
 
Web Technology Part 3
Web Technology Part 3Web Technology Part 3
Web Technology Part 3
Thapar Institute
 
Web Technology Part 2
Web Technology Part 2Web Technology Part 2
Web Technology Part 2
Thapar Institute
 
Web Technology Part 1
Web Technology Part 1Web Technology Part 1
Web Technology Part 1
Thapar Institute
 
TOC Introduction
TOC Introduction TOC Introduction
TOC Introduction
Thapar Institute
 
CSS Introduction
CSS Introduction CSS Introduction
CSS Introduction
Thapar Institute
 
COA (Unit_4.pptx)
COA (Unit_4.pptx)COA (Unit_4.pptx)
COA (Unit_4.pptx)
Thapar Institute
 
COA(Unit_3.pptx)
COA(Unit_3.pptx)COA(Unit_3.pptx)
COA(Unit_3.pptx)
Thapar Institute
 
COA (Unit_2.pptx)
COA (Unit_2.pptx)COA (Unit_2.pptx)
COA (Unit_2.pptx)
Thapar Institute
 
COA (Unit_1.pptx)
COA (Unit_1.pptx)COA (Unit_1.pptx)
COA (Unit_1.pptx)
Thapar Institute
 
Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4)) Software Testing Introduction (Part 4))
Software Testing Introduction (Part 4))
Thapar Institute
 
Software Testing Introduction (Part 3)
 Software Testing Introduction (Part 3) Software Testing Introduction (Part 3)
Software Testing Introduction (Part 3)
Thapar Institute
 
Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)
Thapar Institute
 
Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)
Thapar Institute
 

More from Thapar Institute (19)

Digital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptxDigital Electronics Unit_4_new.pptx
Digital Electronics Unit_4_new.pptx
 
Digital Electronics Unit_3.pptx
Digital Electronics Unit_3.pptxDigital Electronics Unit_3.pptx
Digital Electronics Unit_3.pptx
 
Digital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptxDigital Electronics Unit_2.pptx
Digital Electronics Unit_2.pptx
 
Digital Electronics Unit_1.pptx
Digital Electronics Unit_1.pptxDigital Electronics Unit_1.pptx
Digital Electronics Unit_1.pptx
 
C Language Part 1
C Language Part 1C Language Part 1
C Language Part 1
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction
 
Web Technology Part 3
Web Technology Part 3Web Technology Part 3
Web Technology Part 3
 
Web Technology Part 2
Web Technology Part 2Web Technology Part 2
Web Technology Part 2
 
Web Technology Part 1
Web Technology Part 1Web Technology Part 1
Web Technology Part 1
 
TOC Introduction
TOC Introduction TOC Introduction
TOC Introduction
 
CSS Introduction
CSS Introduction CSS Introduction
CSS Introduction
 
COA (Unit_4.pptx)
COA (Unit_4.pptx)COA (Unit_4.pptx)
COA (Unit_4.pptx)
 
COA(Unit_3.pptx)
COA(Unit_3.pptx)COA(Unit_3.pptx)
COA(Unit_3.pptx)
 
COA (Unit_2.pptx)
COA (Unit_2.pptx)COA (Unit_2.pptx)
COA (Unit_2.pptx)
 
COA (Unit_1.pptx)
COA (Unit_1.pptx)COA (Unit_1.pptx)
COA (Unit_1.pptx)
 
Software Testing Introduction (Part 4))
 Software Testing Introduction (Part 4)) Software Testing Introduction (Part 4))
Software Testing Introduction (Part 4))
 
Software Testing Introduction (Part 3)
 Software Testing Introduction (Part 3) Software Testing Introduction (Part 3)
Software Testing Introduction (Part 3)
 
Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)
 
Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)Software Testing Introduction (Part 1)
Software Testing Introduction (Part 1)
 

Recently uploaded

ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 

Recently uploaded (20)

ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 

Web Technology Part 4

  • 2. What is xml • Xml (eXtensible Markup Language) is a mark up language. • XML is designed to store and transport data. • Xml was released in late 90’s. it was created to provide an easy to use and store self describing data. • XML became a W3C Recommendation on February 10, 1998. • XML is not a replacement for HTML. • XML is designed to be self-descriptive. • XML is designed to carry data, not to display data. • XML tags are not predefined. You must define your own tags. • XML is platform independent and language independent.
  • 3. What is mark-up language • A mark up language is a modern system for highlight or underline a document. • Students often underline or highlight a passage to revise easily, same in the sense of modern mark up language highlighting or underlining is replaced by tags.
  • 4. Features and Advantages of XML • XML is widely used in the era of web development. • It is also used to simplify data storage and data sharing. • The main features or advantages of XML are given below.
  • 5. 1) XML separates data from HTML • If you need to display dynamic data in your HTML document, it will take a lot of work to edit the HTML each time the data changes • With XML, data can be stored in separate XML files. • This way you can focus on using HTML/CSS for display and layout, and be sure that changes in the underlying data will not require any changes to the HTML. • With a few lines of JavaScript code, you can read an external XML file and update the data content of your web page.
  • 6. 2) XML simplifies data sharing • In the real world, computer systems and databases contain data in incompatible formats. • XML data is stored in plain text format. • This provides a software- and hardware- independent way of storing data. • This makes it much easier to create data that can be shared by different applications.
  • 7. 3) XML simplifies data transport • One of the most time-consuming challenges for developers is to exchange data between incompatible systems over the Internet. • Exchanging data as XML greatly reduces this complexity, since the data can be read by different incompatible applications.
  • 8. 4) XML simplifies Platform change • Upgrading to new systems (hardware or software platforms), is always time consuming. • Large amounts of data must be converted and incompatible data is often lost. • XML data is stored in text format. • This makes it easier to expand or upgrade to new operating systems, new applications, or new browsers, without losing data.
  • 9. 5) XML increases data availability • Different applications can access your data, not only in HTML pages, but also from XML data sources. • With XML, your data can be available to all kinds of "reading machines" (Handheld computers, voice machines, news feeds, etc), and make it more available for blind people, or people with other disabilities.
  • 10. XML Example • XML documents create a hierarchical structure looks like a tree so it is known as XML Tree that starts at "the root" and branches to "the leaves".
  • 11. Example of XML Document • XML documents uses a self-describing and simple syntax:
  • 12.
  • 13.
  • 14. • The first line is the XML declaration. • It defines the XML version (1.0) and the encoding used (ISO-8859-1 = Latin-1/West European character set). • The next line describes the root element of the document (like saying: "this document is a note"):
  • 15. • The next 4 lines describe 4 child elements of the root (to, from, heading, and body). • And finally the last line defines the end of the root element.
  • 16. • XML documents must contain a root element. • This element is "the parent" of all other elements. • The elements in an XML document form a document tree. • The tree starts at the root and branches to the lowest level of the tree. • All elements can have sub elements (child elements).
  • 17. • The terms parent, child, and sibling are used to describe the relationships between elements. • Parent elements have children. • Children on the same level are called siblings (brothers or sisters). • All elements can have text content and attributes (just like in HTML).
  • 18. Another Example of XML: Books • File: books.xml • The root element in the example is <bookstore>. • All elements in the document are contained within <bookstore>. • The <book> element has 4 children: <title>,< author>, <year> and <price>.
  • 19.
  • 20.
  • 21. XML Attributes • XML elements can have attributes. • By the use of attributes we can add the information about the element. • XML attributes enhance the properties of the elements. • Let us take an example of a book publisher. Here, book is the element and publisher is the attribute. • <book publisher="Tata McGraw Hill"></book> <book publisher='Tata McGraw Hill'></book>
  • 22.
  • 23.
  • 24.
  • 25. • In the first example, gender is an attribute. In the last example, gender is an element. • Both examples provide the same information. • There are no rules about when to use attributes or when to use elements in XML
  • 26. The id attributes above are for identifying the different notes. It is not a part of the note itself. What I'm trying to say here is that metadata (data about data) should be stored as attributes, and the data itself should be stored as elements.
  • 27. XML Naming Rules • XML elements must follow these naming rules: 1. Element names are case-sensitive 2. Element names must start with a letter or underscore 3. Element names cannot start with the letters xml (or XML, or Xml, etc) 4. Element names can contain letters, digits, hyphens, underscores, and periods 5. Element names cannot contain spaces 6. Any name can be used, no words are reserved (except xml).
  • 28.
  • 29.
  • 30. XML DTD • What is DTD • DTD stands for Document Type Definition. • It defines the legal building blocks of an XML document. • It is used to define document structure with a list of legal elements and attributes.
  • 31. Purpose of DTD • Its main purpose is to define the structure of an XML document. • It contains a list of legal elements and define the structure with the help of them.
  • 32. DTD - XML Building Blocks • The main building blocks of both XML and HTML documents are elements.
  • 33. The Building Blocks of XML Documents • Seen from a DTD point of view, all XML documents are made up by the following building blocks: • Elements • Attributes • Entities • PCDATA • CDATA
  • 34. Elements • Elements are the main building blocks of both XML and HTML documents. • Examples of HTML elements are "body" and "table". • Examples of XML elements could be "note" and "message". • Elements can contain text, other elements, or be empty. • Examples of empty HTML elements are "hr", "br" and "img". • Examples:
  • 35.
  • 36. DTD - Elements • In a DTD, elements are declared with an ELEMENT declaration.
  • 37.
  • 38. Elements with Parsed Character Data • Elements with only parsed character data are declared with #PCDATA inside parentheses:
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45. Attributes • Attributes provide extra information about elements. • Attributes are always placed inside the opening tag of an element. • Attributes always come in name/value pairs. • The following "img" element has additional information about a source file:
  • 46.
  • 47.
  • 48. Entities • Some characters have a special meaning in XML, like the less than sign (<) that defines the start of an XML tag. • Most of you know the HTML entity: "&nbsp;". This "no-breaking-space" entity is used in HTML to insert an extra space in a document. Entities are expanded when a document is parsed by an XML parser. • The following entities are predefined in XML:
  • 49.
  • 50. Note: An entity has three parts: an ampersand (&), an entity name, and a semicolon (;).
  • 51.
  • 52. PCDATA • PCDATA means parsed character data. • Think of character data as the text found between the start tag and the end tag of an XML element. • PCDATA is text that WILL be parsed by a parser. The text will be examined by the parser for entities and markup. • Tags inside the text will be treated as markup and entities will be expanded. • However, parsed character data should not contain any &, <, or > characters; these need to be represented by the &amp; &lt; and &gt; entities, respectively.
  • 53.
  • 54. CDATA • CDATA means character data. • CDATA is text that will NOT be parsed by a parser. • Tags inside the text will NOT be treated as markup and entities will not be expanded. • In this chapter, we will discuss XML CDATA section. • The term CDATA means, Character Data. CDATA is defined as blocks of text that are not parsed by the parser, but are otherwise recognized as markup. • The predefined entities such as &lt;, &gt;, and &amp; require typing and are generally difficult to read in the markup. In such cases, CDATA section can be used. • By using CDATA section, you are commanding the parser that the particular section of the document contains no markup and should be treated as regular text.
  • 55.
  • 56.
  • 57.
  • 58.
  • 60.
  • 61. • In the above example, the DOCTYPE declaration refers to an external DTD file. • The content of the file is shown in below paragraph.
  • 63. Description of DTD • <!DOCTYPE employee : It defines that the root element of the document is employee. • <!ELEMENT employee: It defines that the employee element contains 3 elements "firstname, lastname and email". • <!ELEMENT firstname: It defines that the firstname element is #PCDATA typed. (parse-able data type). • <!ELEMENT lastname: It defines that the lastname element is #PCDATA typed. (parse-able data type). • <!ELEMENT email: It defines that the email element is #PCDATA typed. (parse-able data type).
  • 64. Internal DTD • A DTD is referred to as an internal DTD if elements are declared within the XML files. • To reference it as internal DTD, standalone attribute in XML declaration must be set to yes. • This means the declaration works independent of external source.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69. External DTD • In external DTD elements are declared outside the XML file. • They are accessed by specifying the system attributes which may be either the legal .dtd file or a valid URL. • To reference it as external DTD, standalone attribute in the XML declaration must be set as no. • This means, declaration includes information from the external source.
  • 70.
  • 71.
  • 72.
  • 73.
  • 78. XML DTD with entity declaration • A doctype declaration can also define special strings that can be used in the XML file. An entity has three parts: 1. An ampersand (&) 2. An entity name 3. A semicolon (;)
  • 79. Syntax to declare entity: Let's see a code to define the ENTITY in doctype declaration.
  • 81. In the previous example, sj is an entity that is used inside the author element. In such case, it will print the value of sj entity that is "Sonoo Jaiswal".
  • 82. Checking Validation • Before proceeding with XML DTD, you must check the validation. • An XML document is called "well-formed" if it contains the correct syntax. • A well-formed and valid XML document is one which have been validated against DTD. • Visit http://www.xmlvalidation.com to validate the XML file.
  • 83. Valid and well-formed XML document with DTD • Let's take an example of well-formed and valid XML document. • It follows all the rules of DTD.
  • 84.
  • 85. HTML vs XML • There are many differences between HTML (Hyper Text Markup Language) and XML (eXtensible Markup Language). • The important differences are given below:
  • 86.
  • 87.
  • 88. XML Parsers • An XML parser is a software library or package that provides interfaces for client applications to work with an XML document. • The XML Parser is designed to read the XML and create a way for programs to use XML. • XML parser validates the document and check that the document is well formatted. • Let's understand the working of XML parser by the figure given below:
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94. Parsing a Text String • This example parses a text string into an XML DOM object, and extracts the info from it with JavaScript:
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101. Sending an XMLHttpRequest • A common JavaScript syntax for using the XMLHttpRequest object looks much like this:
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107. Types of XML Parsers • These are the two main types of XML Parsers: 1. DOM 2. SAX
  • 108. DOM (Document Object Model) • A DOM document is an object which contains all the information of an XML document. • It is composed like a tree structure. • The DOM Parser implements a DOM API. • This API is very simple to use.
  • 109. Features of DOM Parser • A DOM Parser creates an internal structure in memory which is a DOM document object and the client applications get information of the original XML document by invoking methods on this document object. • DOM Parser has a tree based structure.
  • 110. • Advantages 1) It supports both read and write operations and the API is very simple to use. 2) It is preferred when random access to widely separated parts of a document is required. • Disadvantages 1) It is memory inefficient. (consumes more memory because the whole XML document needs to loaded into memory). 2) It is comparatively slower than other parsers.
  • 111. SAX (Simple API for XML) • A SAX Parser implements SAX API. • This API is an event based API and less intuitive.
  • 112. Features of SAX Parser • It does not create any internal structure. • 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.
  • 113. • Advantages 1) It is simple and memory efficient. 2) It is very fast and works for huge documents. • Disadvantages 1) It is event-based so its API is less intuitive. 2) Clients never know the full information because the data is broken into pieces.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119. What is 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 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. • XML DOM defines a standard way to access and manipulate XML documents.
  • 120.
  • 121.
  • 122.
  • 123. The XML DOM • All XML elements can be accessed through the XML DOM.
  • 124.
  • 125.
  • 126. XML DOM Nodes • According to the XML DOM, everything in an XML document is a node: • The entire document is a document node • Every XML element is an element node • The text in the XML elements are text nodes • Every attribute is an attribute node • Comments are comment nodes
  • 127.
  • 128.
  • 129.
  • 130.
  • 131. The XML DOM Node Tree • The XML DOM views an XML document as a tree-structure. The tree structure is called a node-tree. • All nodes can be accessed through the tree. Their contents can be modified or deleted, and new elements can be created. • The node tree shows the set of nodes, and the connections between them. The tree starts at the root node and branches out to the text nodes at the lowest level of the tree:
  • 132.
  • 133.
  • 134.
  • 135. • Because the XML data is structured in a tree form, it can be traversed without knowing the exact structure of the tree and without knowing the type of data contained within.
  • 136.
  • 137. XML DOM - Accessing Nodes • With the DOM, you can access every node in an XML document.
  • 138.
  • 139. • Note that the example above only returns <title> elements under the x node. • To return all <title> elements in the XML document use:
  • 140.
  • 141. DOM Node List Length • The length property defines the length of a node list (the number of nodes). • You can loop through a node list by using the length property:
  • 142.
  • 143.
  • 144. XML DOM Example : Load XML File • Let's take an example to show how an XML document ("note.xml") is parsed into an XML DOM object. • This example parses an XML document (note.xml) into an XML DOM object and extracts information from it with JavaScript. • Let's see the XML file that contains message.
  • 146.
  • 147. Let's see the HTML file that extracts the data of XML document using DOM. xmldom.html
  • 148.
  • 149.
  • 150. XML DOM Traverse Node Tree • Traversing means looping through or traveling across the node tree.
  • 151. Traversing the Node Tree • Often you want to loop an XML document, for example: when you want to extract the value of each element. • This is called "Traversing the node tree" • The example below loops through all child nodes of <book>, and displays their names and values:
  • 152.
  • 153. Example explained: Load the XML string into xmlDoc Get the child nodes of the root element For each child node, output the node name and the node value of the text node
  • 154.
  • 155. Websites Hosting • Web hosting is a service of providing online space for storage of web pages. • These web pages are made available via World Wide Web. • The companies which offer website hosting are known as Web hosts. • The servers on which web site is hosted remain switched on 24 x7. • These servers are run by web hosting companies. • Each server has its own IP address. • Since IP addresses are difficult to remember therefore, webmaster points their domain name to the IP address of the server their website is stored on. • It is not possible to host your website on your local computer, to do so you would have to leave your computer on 24 hours a day. • This is not practical and cheaper as well. • This is where web hosting companies comes in.
  • 156. Types of Web Hosting • Web Hosting is a service that allows hosting/post web- server applications( website or web page ) on a computer system through which web-browser client can have easy access to electronic content on the Internet. • Web Server or Web Host is a computer system that provide web hosting. When Internet user’s want to view your website, all they need to do is type your website address or domain into their browser. The user’s computer will then connect to your server and your web pages will be delivered to them through the browser. Basically, the web hosts allows the customers to place documents, such as html pages, graphics, and other multimedia files etc. onto a special type of computer called a web server. It provides constant and high speed connection to the backbone of Internet.
  • 157. Different types of Web hosting services are listed below: • Free Hosting • Virtual or Shared Hosting • Dedicated Hosting • Co-location Hosting
  • 158. 1. Free Hosting : This is a free non-paid web hosting service. This type of hosting is available with many prominent sites that offer to host some web pages for no cost. Advantages : • Free of cost • Use websites to place advertisements. banners and other forms of advertising media Disadvantages: • Customer support is missing • Low bandwidth and lesser data transfer • No control over your website
  • 159. • 2. Shared/Virtual Hosting : Its a web hosting service where many website reside on one web server connected to the internet. This type of hosting is provided under one’s own domain name, www.yourname.com. • With a hosting plan with the wed b hosting company, one can present oneself as a fully independent identity to his/her web audience. Advantages : • Easy and affordable • Secured by hosting provider • 24/7 Technical support Disadvantages: • Shared resources can slow down the whole server • Less flexible than dedicated hosting
  • 160. • 3. Dedicated Hosting : Hosted on a dedicated server, this type of hosting is best suited for large websites with high traffic. In this, the company wishing to go online, rents an entire web server from a hosting company. This is suitable for companies hosting larger websites, maintaining other’s sites or managing a big online mall etc. Advantages : • Ideal for large business • Strong database support • Unlimited software support • Powerful e-mail solutions • Complete root access to your servers Disadvantages: • Its very expensive • Requires superior skill sets
  • 161. • 4. Co-located Hosting : This hosting lets you place your own web server on the premises of a service provider. • It is similar to that of dedicated hosting except for the fact that the server is now provided by the user-company itself and its physical needs are met by the hosting company. Advantages : • Greater Bandwidth High Up-Time • Unlimited Software Options • High Security Disadvantages: • Difficult to configure and debug • Its expensive • Require high skills
  • 163.
  • 164.
  • 165. Websites Publishing • Website publishing is the process of uploading content on the internet. It includes: • uploading files • updating web pages • posting blogs
  • 166. Prerequisites for Website Publishing • In order to publish your site, you need the following things: • Web development software • Internet Connection • Web Server
  • 167. Web development software • It is used for building web pages for your web site. Dreamweaver and WordPress are example of web development softwares. Internet Connection • Internet connection is required to connect to a remotely located web server. Web Server • Web server is the actual location where your website resides on. A web server may host single or multiple sites depending on what hosting service you have paid for.
  • 168. Adobe Dreamweaver • Adobe Dreamweaver is a software for designing web pages. • These HTML web pages are fully featured. • This software provides a WYSIWYG i.e., What You See Is What You Get interface for creating and editing the web pages. • The Adobe Dreamweaver software supports many markup languages like HTML, XML, CSS, and JavaScript. • It supports English, Spanish, French, German, Japanese, Chinese, etc.... • The Dreamweaver was developed by Macromedia, and it was published in 1997. • In 2005 the Adobe had purchased Dreamweaver and name it as Adobe Dreamweaver
  • 169. Features of Adobe Dreamweaver • 1. Fast, flexible coding. • Creating, coding, and managing the websites becomes very easy because of the simplified coding engine. Using this software, HTML, CSS, and other web standards can be quickly learned. It speeds up the development of the web site. • 2. Setup to site up in fewer steps. • It becomes very easy to set up a web site, and starter templates can be run very fast. Templates can be customized for email, About pages, blogs, e-commerce pages, newsletters, and portfolios. For reading codes, code coloring and visual hints can be used for quickly editing and updating.
  • 170. • 3. Dynamic display on every device. • Using Adobe Dreamweaver responsive websites can build that can be fit into any screen size. This helps in previewing sites and editing makes sure that the page looks and works the same way that you want.