You are on page 1of 30

Introduction

to
< XML />
What is XML?
• Extensible Markup Language (XML) - allows you to
describe and organize information in ways that are easily
understandable by both humans and computers.
• XML derived from the older standard called Standard
Generalized Markup Language (SGML), is a metalanguage.
XM
L
• You can use XML to create your own markup language that
includes a set of rules and tags that describe information
suited to your needs.

• Most widely-used formats for sharing structured information


today
• tags provides the structure to the data
• text that you want to store is surrounded by these tags.
• XML file is a standard text file that utilizes customized
tags
• MS Office 2007 and later use XML for its document
structure. (.docx, .xslx, .pptx)
Difference between HTML
and XML
• HTML
- Information is displayed Language used for
encoding web pages.

• XML
- Information is transferred Language used for data
description and used to store data
Extensible Markup Language

1 2 3
Uses <> tags or marks Simplifies Things Data Exchange

In XML it uses own tags and it • XML simplifies data It is used for Data
is not limited and not sharing Exchange and
predefined • XML simplifies data communication
transport between two
• XML simplifies applications
platform changes
• XML simplifies data
availability
Advantages of XML Common Uses of XML

• Readability • Web Publishing


• Compatibility • Web Tasks
• Customization • General Applications
XML Technologies

These are set of modules that provides XML users with useful
services.

• XSL
• XPath
• XLink
• XQuery
XSL - Extensible Stylesheet Language
- developed by the World Wide Web Consortium
- described how XML should be displayed

3 parts of XSL:

• XSLT
• XPath
• XSL-FO
I have several friends.
Jose, Maria, and Juan are my
friends.

Klin is my best friend.


I have several friends.
Jose, Maria, and Juan are my
friends.

Klin is my best friend.

• Structured
• Formatted
• Common rule & syntax
I have several friends.
Jose, Maria, and Juan are my
friends.

Klin is my best friend.

• Structured
• Formatted
• Common rule & syntax
XML
Syntax
XML
Optional and is the first line
PROLOG
XML
Optional and is the first line
PROLOG
ROOT
Must contain a root element that is parent of all elements
XML
Optional and is the first line
PROLOG
ROOT
Must contain a root element that is parent of all elements

TAGS
All elements must have a closing tag, XML Tags are Case Sensitive
XML
Optional and is the first line
PROLOG
ROOT
Must contain a root element that is parent of all elements

TAGS
All elements must have a closing tag, XML Tags are Case Sensitive

ATTRIBUTES
Must always be quoted
XML
Optional and is the first line
PROLOG
ROOT
Must contain a root element that is parent of all elements

TAGS
All elements must have a closing tag, XML Tags are Case Sensitive

ATTRIBUTES
Must always be quoted

NESTING
XML Elements must be nested properly
XML
Optional and is the first line
PROLOG
ROOT
Must contain a root element that is parent of all elements

TAGS
All elements must have a closing tag, XML Tags are Case Sensitive

ATTRIBUTES
Must always be quoted

NESTING
XML Elements must be nested properly

COMMENTS
XML
Optional and is the first line
PROLOG
ROOT
Must contain a root element that is parent of all elements

TAGS
All elements must have a closing tag, XML Tags are Case Sensitive

ATTRIBUTES
Must always be quoted

NESTING
XML Elements must be nested properly

COMMENTS

WHITE SPACES
XML Namespace
Name conflicts in XML and can be resolved by using PREFIX
Name conflicts in XML and can be resolved by using PREFIX
Name conflicts in XML and can be resolved by using PREFIX
When using Prefixes in XML, a Namespace for prefix must be defined

xmlns:prefix="URI"
XMLNS Attribute
When using Prefixes in XML, a Namespace for prefix must be defined

xmlns:prefix="URI"
The namespace can be declared and defined
in the starting of the element or the starting of
the XML in the root element itself

all child elements with the same prefix are


associated with the same namespace
XMLNS Attribute
When using Prefixes in XML, a Namespace for prefix must be defined

xmlns:prefix="URI"
The namespace can be declared and defined
in the starting of the element or the starting of
the XML in the root element itself

all child elements with the same prefix are


associated with the same namespace

Namespace can also be declared in the XML


root element
THANK
YOU!!!

You might also like