SlideShare uma empresa Scribd logo
1 de 24
ObjectivesObjectives
History andMarkup languages
Comparison between XML and
HTML
XML Syntax
XML Design rationale
XML Elements and Attribute
XML DTD
XML Validation
HistoryHistory
SGML
HTML
XML
1985 1990
1995/98
Standardized General Markup Language
HyperText Markup Language
eXtensible Markup Language
Introduction of XML
 XML stands for EXTENSIBLE MARKUP
LANGUAGE.
 XML represent the text information in a
standard format .
 XML was designed to transport and store
information.
 It is used for documents containing structure
information in a reliable way.
What do mark up languages
do?
􀂄 Markup languages consist of a set of
markup
conventions used for encoding texts.
􀂄 A markup language specifies –
􀂄 What markup is allowed
􀂄 What markup is required
􀂄 How the mark up is distinguished from
text
􀂄 What the markup means
Features of XML
• XML files are text files, which can be managed
by any text editor.
• XML is very simple, because it has less than
10 syntax rules.
• XML tags are not predefined. You must define
your own tags
• XML is designed to be self-descriptive
ADVANTAGES OF XML
 It can represent common computer science data
structures: records, lists and trees.
 Its self-documenting format describes structure and
field names as well as specific values.
 The strict syntax and parsing requirements make the
necessary parsing algorithms extremely simple,
efficient, and consistent
 XML is heavily used as a format for document storage
and processing, both online and offline.
How is XML different from
HTML?
 HTML and XML have different sets of goals.
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’.
 XML Does Not DO Anything
 HTML and XML are complementary to each
other.
XML Syntax Rules
 Now lets take a look at some of the
important rules of XML syntax.
 All XML Elements Must Have a Closing Tag
 XML Tags are Case Sensitive
<p>This is a
paragraph.</p>
<br />
. The tag <Letter>
is different from
the tag <letter>.
XML Syntax Rules
XML Elements Must be Properly Nested
XML Documents Must Have a Root Element
<b><i>This
text is bold
and
italic</i></b>
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
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
Authoring XML
Elements
An XML element is made up of a start tag, an end tag,
and data in between.
Example:
<director> Matthew Dunn </director>
Example of another element with the same value:
<actor> Matthew Dunn </actor>
XML tags are case-sensitive:
<CITY> <City> <city>
Authoring XML Attribute
(cont’d)
An attribute is a name-value pair separated by an
equal sign (=).
Example:
<City ZIP=“94608”> Emeryville </City>
Attributes are used to attach additional, secondary
information to an element.
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.
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.
Document Type Definitions (DTDs 1)Document Type Definitions (DTDs 1)
XML document types can be specified using a DTD
DTD does not constrain data types
All values represented as strings in XML
DTD definition syntax
<!ELEMENT element (subelements-specification) >
<!ATTLIST element (attributes) >
… more details later
Valid XML documents refer to a DTD (or other
Schema)
Document Type Definitions (DTDs 2)Document Type Definitions (DTDs 2)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE test PUBLIC "-//Webster//DTD test V1.0//EN"
<test> "test" is a document element </test>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE test PUBLIC "-//Webster//DTD test V1.0//EN"
<test> "test" is a document element </test>
<!DOCTYPE test [
<!ELEMENT test EMPTY> ]>
<test/>
<!DOCTYPE test [
<!ELEMENT test EMPTY> ]>
<test/>
External Public DTD Declaration
Internal DTD Declaration
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE test SYSTEM "test.dtd">
<test> "test" is a document element </test>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE test SYSTEM "test.dtd">
<test> "test" is a document element </test>
External DTD Declaration referring to a file or a URL
test =
name of
the root
element
DTD is
defined in
file test.dtd
DTD is
defined
inside XML
Application
should
know DTD
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
What is a well-formed XML document ?What is a well-formed XML document ?
Well-formed documents follow basic syntax rules e.g.
there is an XML declaration in the first line
there is a single document root
all tags use proper delimiters
all elements have start and end tags
But can be minimized if empty: <br/> instead of
<br></br>
all elements are properly nested
<author> <firstname>Mark</firstname>
<lastname>Twain</lastname> </author>
appropriate use of special characters
XML Validator
Use our XML validator to syntax-check your XML.
XML Errors Will Stop You
Syntax-Check Your XML
Syntax-Check an XML File
Validate Your XML Against a DTD
Viewing XML Files
Raw XML files can be viewed in all major browsers.
Don't expect XML files to be displayed as HTML pages.
Viewing XML Files
Viewing an Invalid XML File
Look at this
XML file:
note.xml
Look at this
XML file:
note_error.xml
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
SummarSummarYY
XML has a wide range of applications
XML is just a formalism (meta-language), unlike HTML
The W3C framework includes
General purpose (accessory, transducing, ..) languages such as XML
Schema, XSLT, XPath, XQuery, Xlink, RDF, …
Useful languages for contents (vector graphics, multimedia animation,
formulas
Other organizations
Define domain-specific vocabularies
Define alternative XML-based general purpose languages
XML is mostly used “behind the scene”, but increasingly
directly for web contents (via XSLT mostly)

Mais conteúdo relacionado

Mais procurados (20)

Xml dtd
Xml dtdXml dtd
Xml dtd
 
Document Type Definition
Document Type DefinitionDocument Type Definition
Document Type Definition
 
Xml by Luqman
Xml by LuqmanXml by Luqman
Xml by Luqman
 
Extensible Markup Language (XML)
Extensible Markup Language (XML)Extensible Markup Language (XML)
Extensible Markup Language (XML)
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
 
XML - EXtensible Markup Language
XML - EXtensible Markup LanguageXML - EXtensible Markup Language
XML - EXtensible Markup Language
 
XML Schema
XML SchemaXML Schema
XML Schema
 
Sgml and xml
Sgml and xmlSgml and xml
Sgml and xml
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
EXtensible Markup Language
EXtensible Markup LanguageEXtensible Markup Language
EXtensible Markup Language
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1
 
DTD
DTDDTD
DTD
 
XML
XMLXML
XML
 
XML
XMLXML
XML
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
XML Databases
XML DatabasesXML Databases
XML Databases
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
XML
XMLXML
XML
 

Semelhante a Intro to xml

Semelhante a Intro to xml (20)

XML-Unit 1.ppt
XML-Unit 1.pptXML-Unit 1.ppt
XML-Unit 1.ppt
 
Xml
XmlXml
Xml
 
Oracle soa xml faq
Oracle soa xml faqOracle soa xml faq
Oracle soa xml faq
 
Xml 1
Xml 1Xml 1
Xml 1
 
Xml viva questions
Xml viva questionsXml viva questions
Xml viva questions
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
chapter 4 web authoring unit 4 xml.pptx
chapter 4 web authoring  unit 4 xml.pptxchapter 4 web authoring  unit 4 xml.pptx
chapter 4 web authoring unit 4 xml.pptx
 
xml introduction in web technologies subject
xml introduction in web technologies subjectxml introduction in web technologies subject
xml introduction in web technologies subject
 
Web Technologies Unit 2 Print.pdf
Web Technologies Unit 2 Print.pdfWeb Technologies Unit 2 Print.pdf
Web Technologies Unit 2 Print.pdf
 
Unit 5 xml (1)
Unit 5   xml (1)Unit 5   xml (1)
Unit 5 xml (1)
 
distributed system concerned lab sessions
distributed system concerned lab sessionsdistributed system concerned lab sessions
distributed system concerned lab sessions
 
Xml
XmlXml
Xml
 
Xml
XmlXml
Xml
 
Xml andweb services
Xml andweb services Xml andweb services
Xml andweb services
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
Xml sasidhar
Xml  sasidharXml  sasidhar
Xml sasidhar
 
Web Development Course - XML by RSOLUTIONS
Web Development Course - XML by RSOLUTIONSWeb Development Course - XML by RSOLUTIONS
Web Development Course - XML by RSOLUTIONS
 
XML
XMLXML
XML
 
XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
 
Module 5 XML Notes.pdf
Module 5 XML Notes.pdfModule 5 XML Notes.pdf
Module 5 XML Notes.pdf
 

Último

RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...amitlee9823
 
Case Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, PuneCase Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, PuneLukeKholes
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...ranjana rawat
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja Nehwal
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxjeswinjees
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...kumaririma588
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdftbatkhuu1
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
 
infant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptxinfant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptxsuhanimunjal27
 
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts ServiceVVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Servicearoranaina404
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...Delhi Call girls
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...Call Girls in Nagpur High Profile
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxTusharBahuguna2
 
Pastel Portfolio _ by Slidesgo.pptx. Xxx
Pastel Portfolio _ by Slidesgo.pptx. XxxPastel Portfolio _ by Slidesgo.pptx. Xxx
Pastel Portfolio _ by Slidesgo.pptx. XxxSegundoManuelFaichin1
 

Último (20)

RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
Case Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, PuneCase Study of Hotel Taj Vivanta, Pune
Case Study of Hotel Taj Vivanta, Pune
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(AISHA) Ambegaon Khurd Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptx
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
 
infant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptxinfant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptx
 
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts ServiceVVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptx
 
Pastel Portfolio _ by Slidesgo.pptx. Xxx
Pastel Portfolio _ by Slidesgo.pptx. XxxPastel Portfolio _ by Slidesgo.pptx. Xxx
Pastel Portfolio _ by Slidesgo.pptx. Xxx
 

Intro to xml

  • 1.
  • 2. ObjectivesObjectives History andMarkup languages Comparison between XML and HTML XML Syntax XML Design rationale XML Elements and Attribute XML DTD XML Validation
  • 3. HistoryHistory SGML HTML XML 1985 1990 1995/98 Standardized General Markup Language HyperText Markup Language eXtensible Markup Language
  • 4. Introduction of XML  XML stands for EXTENSIBLE MARKUP LANGUAGE.  XML represent the text information in a standard format .  XML was designed to transport and store information.  It is used for documents containing structure information in a reliable way.
  • 5. What do mark up languages do? 􀂄 Markup languages consist of a set of markup conventions used for encoding texts. 􀂄 A markup language specifies – 􀂄 What markup is allowed 􀂄 What markup is required 􀂄 How the mark up is distinguished from text 􀂄 What the markup means
  • 6. Features of XML • XML files are text files, which can be managed by any text editor. • XML is very simple, because it has less than 10 syntax rules. • XML tags are not predefined. You must define your own tags • XML is designed to be self-descriptive
  • 7. ADVANTAGES OF XML  It can represent common computer science data structures: records, lists and trees.  Its self-documenting format describes structure and field names as well as specific values.  The strict syntax and parsing requirements make the necessary parsing algorithms extremely simple, efficient, and consistent  XML is heavily used as a format for document storage and processing, both online and offline.
  • 8. How is XML different from HTML?  HTML and XML have different sets of goals. 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’.  XML Does Not DO Anything  HTML and XML are complementary to each other.
  • 9. XML Syntax Rules  Now lets take a look at some of the important rules of XML syntax.  All XML Elements Must Have a Closing Tag  XML Tags are Case Sensitive <p>This is a paragraph.</p> <br /> . The tag <Letter> is different from the tag <letter>.
  • 10. XML Syntax Rules XML Elements Must be Properly Nested XML Documents Must Have a Root Element <b><i>This text is bold and italic</i></b> <root> <child> <subchild>.....</subchild> </child> </root>
  • 11. 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
  • 12. Authoring XML Elements An XML element is made up of a start tag, an end tag, and data in between. Example: <director> Matthew Dunn </director> Example of another element with the same value: <actor> Matthew Dunn </actor> XML tags are case-sensitive: <CITY> <City> <city>
  • 13. Authoring XML Attribute (cont’d) An attribute is a name-value pair separated by an equal sign (=). Example: <City ZIP=“94608”> Emeryville </City> Attributes are used to attach additional, secondary information to an element.
  • 14. 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.
  • 15. 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.
  • 16. Document Type Definitions (DTDs 1)Document Type Definitions (DTDs 1) XML document types can be specified using a DTD DTD does not constrain data types All values represented as strings in XML DTD definition syntax <!ELEMENT element (subelements-specification) > <!ATTLIST element (attributes) > … more details later Valid XML documents refer to a DTD (or other Schema)
  • 17. Document Type Definitions (DTDs 2)Document Type Definitions (DTDs 2) <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE test PUBLIC "-//Webster//DTD test V1.0//EN" <test> "test" is a document element </test> <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE test PUBLIC "-//Webster//DTD test V1.0//EN" <test> "test" is a document element </test> <!DOCTYPE test [ <!ELEMENT test EMPTY> ]> <test/> <!DOCTYPE test [ <!ELEMENT test EMPTY> ]> <test/> External Public DTD Declaration Internal DTD Declaration <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE test SYSTEM "test.dtd"> <test> "test" is a document element </test> <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE test SYSTEM "test.dtd"> <test> "test" is a document element </test> External DTD Declaration referring to a file or a URL test = name of the root element DTD is defined in file test.dtd DTD is defined inside XML Application should know DTD
  • 18. 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
  • 19. What is a well-formed XML document ?What is a well-formed XML document ? Well-formed documents follow basic syntax rules e.g. there is an XML declaration in the first line there is a single document root all tags use proper delimiters all elements have start and end tags But can be minimized if empty: <br/> instead of <br></br> all elements are properly nested <author> <firstname>Mark</firstname> <lastname>Twain</lastname> </author> appropriate use of special characters
  • 20. XML Validator Use our XML validator to syntax-check your XML. XML Errors Will Stop You Syntax-Check Your XML Syntax-Check an XML File Validate Your XML Against a DTD
  • 21. Viewing XML Files Raw XML files can be viewed in all major browsers. Don't expect XML files to be displayed as HTML pages. Viewing XML Files Viewing an Invalid XML File Look at this XML file: note.xml Look at this XML file: note_error.xml
  • 22. XML applications 􀂄 B2B 􀂄 EDI 􀂄 Journal publishing 􀂄 Database development
  • 23. 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
  • 24. SummarSummarYY XML has a wide range of applications XML is just a formalism (meta-language), unlike HTML The W3C framework includes General purpose (accessory, transducing, ..) languages such as XML Schema, XSLT, XPath, XQuery, Xlink, RDF, … Useful languages for contents (vector graphics, multimedia animation, formulas Other organizations Define domain-specific vocabularies Define alternative XML-based general purpose languages XML is mostly used “behind the scene”, but increasingly directly for web contents (via XSLT mostly)