Unit-1 XML
Unit-1 XML
Extensible Markup Language (XML) lets you define and store data in a shareable manner. XML
supports information exchange between computer systems such as websites, databases, and
third-party applications. Predefined rules make it easy to transmit data as XML files over any
network because the recipient can use those rules to read the data accurately and efficiently.
Extensible Markup Language (XML) is a markup language that provides rules to define any
data. Unlike other programming languages, XML cannot perform computing operations by
itself. Instead, any programming language or software can be implemented for structured data
management.
For example, consider a text document with comments on it. The comments might give
suggestions like these:
Such comments improve the document’s usability without affecting its content. Similarly, XML
uses markup symbols to provide more information about any data. Other software, like browsers
and data processing applications, use this information to process structured data more
efficiently.
XML tags
You use markup symbols, called tags in XML, to define data. For example, to represent data for
a bookstore, you can create tags such as <book>, <title>, and <author>. Your XML document
for a single book would have content like this:
<book>
<title> Learning Amazon Web Services </title>
</book>
Tags bring sophisticated data coding to integrate information flows across different systems.
When a company sells a good or service to another company, the two businesses need to
exchange information like cost, specifications, and delivery schedules. With Extensible Markup
Language (XML), they can share all the necessary information electronically and close complex
deals automatically, without any human intervention.
XML lets you transfer data along with the data’s description, preventing the loss of data
integrity. You can use this descriptive information to do the following:
Computer programs like search engines can sort and categorize XML files more efficiently and
precisely than other types of documents. For example, the word mark can be either a noun or a
verb. Based on XML tags, search engines can accurately categorize mark for relevant search
results. Thus, XML helps computers to interpret natural language more efficiently.
Design flexible applications
With XML, you can conveniently upgrade or modify your application design. Many
technologies, especially newer ones, come with built-in XML support. They can automatically
read and process XML data files so that you can make changes without having to reformat your
entire database.
Data transfer
You can use XML to transfer data between two systems that store the same data in different
formats. For example, your website stores dates in MM/DD/YYYY format, but your accounting
system stores dates in DD/MM/YYYY format. You can transfer the data from the website to the
accounting system by using XML. Your developers can write code that automatically converts
the following:
Web applications
XML gives structure to the data that you see on webpages. Other website technologies, like
HTML, work with XML to present consistent and relevant data to website visitors. For example,
consider an e-commerce website that sells clothes. Instead of showing all clothes to all visitors,
the website uses XML to create customized webpages based on user preferences. It shows
products from specific brands by filtering the <brand> tag.
Documentation
You can use XML to specify the structural information of any technical document. Other
programs then process the document structure to present it flexibly. For example, there are XML
tags for a paragraph, an item in a numbered list, and a heading. Using these tags, other types of
software automatically prepare the document for uses such as printing and webpage publication.
Data type
Many programming languages support XML as a data type. With this support, you can easily
write programs in other languages that work directly with XML files.
An Extensible Markup Language (XML) file is a text-based document that you can save with
the .xml extension. You can write XML similar to other text files. To create or edit an XML file,
you can use any of the following:
XML document
The <xml></xml> tags are used to mark the beginning and end of an XML file. The content
within these tags is also called an XML document. It is the first tag that any software will look
for to process XML code.
XML declaration
An XML document begins with some information about XML itself. For example, it might
mention the XML version that it follows. This opening is called an XML declaration. Here's an
example.
XML elements
All the other tags you create within an XML document are called XML elements. XML
elements can contain these features:
● Text
● Attributes
● Other elements
All XML documents begin with a primary tag, which is called the root element.
<InvitationList>
<family>
<aunt>
<name>Christine</name>
<name>Stephanie</name>
</aunt>
</family>
</InvitationList>
<InvitationList> is the root element; family and aunt are other element names.
XML attributes
XML elements can have other descriptors called attributes. You can define your own attribute
names and write the attribute values within quotation marks as shown below.
<person age=“22”>
XML content
The data in XML files is also called XML content. For example, in the XML file, you might see
data like this.
<friend>
<name>Charlie</name>
<name>Steve</name>
</friend>
For example, an XML schema for bookstores might impose constraints like these:
To meet these constraints, we will write the XML file as shown below.
<category name=“Technology”>
<price>$20</price>
</book>
</category>
XML schemas enforce consistency in how different software applications create and use XML
files. Some industries implement XML schemas that are specific to their operations to reduce
complexity in writing XML code for interbusiness data transfer. For example, Scalable Vector
Graphics (SVG) is an XML specification for describing computer graphics-related data.
Software developers write XML files so that they meet such industry specifications.
Software applications use XML parsers to transform XML files into native data types. They can
thus focus on the application logic without having to go into the details of the XML itself.
HyperText Markup Language (HTML) is the language used in most web pages. A web browser
processes the HTML documents and displays them as a multimedia page. The World Wide Web
Consortium (W3C) is the international community that develops protocols and guidelines to
ensure the long-term growth of the web. W3C established both the HTML and Extensible
Markup Language (XML) standards that website developers implement for consistency and
quality.
While HTML and XML files look very similar, there are some key differences.
Purpose
The purpose of HTML is to present and display data. However, XML stores and transports data.
Tags
HTML has predefined tags, but users can create and define their own tags in XML.
Syntax rules
There are some minor yet important differences between HTML and XML syntax. For example,
XML is case sensitive, but HTML is not. XML parsers will give errors if you write a tag as
<Book> instead of <book>.
CORBA
Stands for Common Object Request Broker Architecture, a standard that allows
systems on different platforms to communicate. CORBA uses an object-oriented
model, but the systems that use it don't have to be object-oriented. CORBA is
used in airline reservations, e-commerce, telco transactions, and financial
systems.
RMI
Stands for Java Remote Method Invocation, a mechanism that allows software
components to work together on multiple computers and in multiple computer
languages.
DCOM
Allows users to implement security through Access Control Lists (ACLs). ACLs
contain a list of users and groups that are allowed to access a resource.