Beruflich Dokumente
Kultur Dokumente
XML:Concepts….
Outline
Markup languages
XML features
XML Syntax
XML Elements
Element naming rules
XML Attributes
XML DTD
Displaying XML document
XML Validation
1
Markup languages
XML stands for
eXtensible
Markup
Language
What is a language?
A languages is a conduit or a medium
to ‘carry’ data.
A language is also a system of coding
data.
A language is a system through which
‘data’ is represented, transmitted and
finally received by the intended
recipient/s.
2
What is mark up?
‘mark up’ are codes inserted into electronic texts to
govern formatting, printing or other processes.
There are two types of Markup Languages:
Descriptive
Procedural
A descriptive markup language simply indicates the
nature, function or content of the data in a file rather
than saying how that data should be processed. It
uses mark up codes to provide names to categorise
parts of a documents
3
What do mark up languages
do?
4
How is XML different from
HTML?
Markup languages generally combine two distinct
functions of representing text (document) –the ‘look’
and the ‘structure’.
HTML and XML have different sets of goals. While
HTML was designed to display data and hence
focused on the ‘look’ of the data, XML was designed
to describe and carry data and hence focuses on
‘what data is’.
HTML is about displaying data and XML is about
describing data.
HTML and XML are complementary to each other.
5
XML features
IT also defines how URLs can be used to
identify component parts of XML data
streams
XML is free and extensible. Unlike HTML tags
are not predefined and fixed. The Tags used
to mark up and structure HTML documents
are predefined. Where as in XML, one can
extend the tags-hence the name extensible.
One can define one’s tags.
XML can be developed for specific
applications Ex: MathML, CML
XML: Concept, applications, case studies PI-6 11
15-20 April 2002
XML features
XML can be used to create new languages. Ex: WML,
VRML
XML uses the concept of document type and hence a
DTD (Document Type Definition) to describe data
XML with DTD is self descriptive
XML separates data from display formats
XML can be used as a format to exchange data
Data can be stored in either files or databases.
6
XML Syntax
XML Syntax consists of
XML Declaration
XML Elements
XML Attributes
XML Elements
An Element is a technical term for a
textual unit, viewed as a structural
component.
Different types of elements are given
different names
The names do not express meaning and
meanings are application dependent
XML elements are extensible
7
XML Elements
Elements have relationships
Elements are related as parents and
children
They only express relationship with
other elements
8
Rules of Elements
All XML elements must have closing tags. In HTML
some elements do not have closing tags.
XML tags are case sensitive
An element <Title> is different from <title>
Therefore the opening and closing tags must be
written in the same case
All XML elements must be properly nested
All XML documents must have a root element
The first element is a root element. All other
elements must be nested within this root element
General Structure
<root>
<child>
<subchild>…….</subchild>
</child>
</root>
9
Element Naming Rules
Names can contain letters, numbers
and other characters
Names must not begin with a number
or punctuation character
Names must not begin with the letters
xml or XML or Xml…
Names cannot contain spaces
XML Attributes
10
XML Attributes
XML elements can have attributes in
name/value pairs as in HTML.
Attributes must always be in quotes.
Either single or double quotes are valid,
though double quotes are most
common.
Attributes are always contained within
the start tag of an element.
11
Case 2 ( Elements)
<Book>
<no>99-2356</no>
<type>CD</type>
< author>
< firstname>Padmini</firstname>
<lastname>Ranganath</lastname>
</author>
</Book>
XML: Concept, applications, case studies PI-6 23
15-20 April 2002
12
What is an XML DTD ?
DTD stands for Document Type Definition.
DTD is a formal model for defining the role
of each element
It formally defines the relationship between
the various elements that form the
documents.
The purpose of a Document Type Definition is
to define the legal building blocks of an XML
document.
XML DTD
It defines the document structure with a list
of legal elements.
An XML DTD allows computers to check that
each component of document occurs in a
valid place within the document.
For example it allows computers to check
that users do not accidentally enter a third
level of heading without first having a
second level heading, etc.
XML: Concept, applications, case studies PI-6 26
15-20 April 2002
13
DTD…
The DTD can be Internal or external
An internal DTD refers to a case where
the XML document has the DTD inline
Where as an external DTD is one where
the document instance is separated
from the formal definition of elements
14
<?xml version="1.0" encoding="UTF-8"
standalone="no" ?>
<?xml-stylesheet type="text/xsl" href="exxsl.xsl" ?
<Metadata>
<thesesinfo>
<title>Discrete coded wave forms for signal processing
Radar</title>
<creator>Abbasi, Zia Ahmad</creator>
<contributor>Prof.Farid Ghani</contributor>
<subject>Electronic Engineering</subject>
<language>English</language>
<university>Aligarh Muslim University,Aligarh, Uttar
Pradesh</university>
<date>1998</date>
</thesesinfo>
15
Title Discrete coded wave forms for signal processin
Language English
Year15-20 April 2002 1998 XML: Concept, applications, case studies PI-6 31
<?xml-stylesheet type="text/xsl"
href="inxsl.xsl" ?>
<Metadata>
<thesesinfo>
<title>Discrete coded wave forms for signal
processing Radar</title>
<creator>Abbasi, Zia Ahmad</creator>
<contributor>Prof.Farid Ghani</contributor>
<subject>Electronic Engineering</subject>
<language>English</language>
<university>Aligarh Muslim University,Aligarh,
Uttar Pradesh</university>
<date>1998</date>
</thesesinfo>
16
XML Validation
There are two types of XML documents
“Well formed” XML
An XML document that conforms to the
syntax of XML is called ‘well formed’
“Valid” XML
An XML document that conforms to a
DTD
Is called a ‘Valid’ DTD
XML: Concept, applications, case studies PI-6 33
15-20 April 2002
XML strengths
Its ability to describe data
Its ability to structure data
Separate display from structure
Long term archival feature
Non proprietary
Supported by industry
Availability of tools
XML: Concept, applications, case studies PI-6 34
15-20 April 2002
17
XML applications
B2B
EDI
Journal publishing
Database development
XML future
Given the direction in which it is growing
and the level of support that XML has
received the XML appears to be the
future of Web publishing
18
Thank U
19