xml

Views:
 
Category: Education
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Slide 1: 

XML

Slide 2: 

XML stands for eXtensible Markup Language.

Slide 3: 

XML was designed to transport and store data. HTML was designed to display data.

What is SGML? : 

What is SGML? SGML is the international standard for defining descriptions of the structure and content of different types of electronic documents A universal language used to describe thousands of different data types

Slide 5: 

The advantages of SGML are: Capable of dealing with any media type or linking protocol Extremely flexible Separates content from appearance Stylesheets make content repurposing easy ISO standard - thus well supported with many tools available The disadvantages of SGML are: Creating DTD's requires exacting software engineering Linking tends to be complex Writing SGML software is extremely hard SGML tools tend to be expansive       Overall, SGML can be extremely complex and not widely used.

What is HTML? : 

What is HTML? HTML is HyperText Markup Language, a specific application of SGML used on the World Wide Web A simple, fixed type of document. Markup designed for simple reports with provisions for hypertext links and multimedia

Slide 7: 

The advantages of HTML are: Simple and easy to understand. The HTML's syntax has always been looser and more forgiving. The disadvantages of HTML are: Insufficient tags for some advance HTML coder. Hard to find exactly what are you looking for. Too much formatting built right into the documents, and by extension. Inconsistent formatting by browsers. Tags recognized by one browser may not be recognized by others.

Slide 8: 

What is XML? XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to carry data, not to display data XML tags are not predefined. You must define your own tags XML is designed to be self-descriptive XML is a software- and hardware-independent tool for carrying information.

Slide 9: 

Advantages:::::::::: 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. 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.

Slide 10: 

XML Simplifies Platform Changes 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. XML Makes Your Data More Available 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.

Slide 11: 

XML documents form a tree structure that starts at "the root" and branches to "the leaves". <?xml version="1.0" encoding="ISO-8859-1"?> <note>  <to>Tove</to>  <from>Jani</from>  <heading>Reminder</heading>  <body>Good Afternoon ! </body></note> Root Element Child Elements

Slide 12: 

XML Syntax Rules All XML Elements Must Have a Closing Tag XML Tags are Case Sensitive XML Elements Must be Properly Nested XML Documents Must Have a Root Element XML Attribute Values Must be Quoted

Slide 13: 

XML Validation XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML.

Slide 14: 

Well Formed XML Documents A "Well Formed" XML document has correct XML syntax. XML documents must have a root element XML elements must have a closing tag XML tags are case sensitive XML elements must be properly nested XML attribute values must be quoted

Slide 15: 

Valid XML Documents A "Valid" XML document is a "Well Formed" XML document, which also conforms to the rules of a Document Type Definition (DTD) NOW……….. What is DTD ?????

Slide 16: 

XML DTD The purpose of a DTD is to define the structure of an XML document. It defines the structure with a list of legal elements: With a DTD, each of your XML files can carry a description of its own format. With a DTD, independent groups of people can agree to use a standard DTD for interchanging data. Your application can use a standard DTD to verify that the data you receive from the outside world is valid. You can also use a DTD to verify your own data.

Slide 17: 

<!DOCTYPE note[<!ELEMENT note (to,from,heading,body)><!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT heading (#PCDATA)><!ELEMENT body (#PCDATA)>] >

TYPES OF DTD : 

TYPES OF DTD INTERNAL DTD <?xml version="1.0"?><!DOCTYPE note [<!ELEMENT note (to,from,heading,body)><!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT heading (#PCDATA)><!ELEMENT body (#PCDATA)>] ><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Good Afternoon!!!</body></note>

External DTD : 

External DTD <?xml version="1.0"?><!DOCTYPE note SYSTEM "note.dtd"><note>  <to>Tove</to>  <from>Jani</from>  <heading>Reminder</heading>  <body>Good Afternoon!</body></note> note.dtd <!ELEMENT note (to,from,heading,body)><!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT heading (#PCDATA)><!ELEMENT body (#PCDATA)>

Declaring Only One Occurrence of an Element : 

Declaring Only One Occurrence of an Element <!ELEMENT element-name (child-name)>Example:<!ELEMENT note (message)> The example above declares that the child element "message" must occur once, and only once inside the "note" element.

Declaring Minimum One Occurrence of an Element : 

Declaring Minimum One Occurrence of an Element <!ELEMENT element-name (child-name+)>Example:<!ELEMENT note (message+)>The + sign in the example above declares that the child element "message" must occur one or more times inside the "note" element.

Declaring Zero or More Occurrences of an Element : 

Declaring Zero or More Occurrences of an Element <!ELEMENT element-name (child-name*)>Example:<!ELEMENT note (message*)> The * sign in the example above declares that the child element "message" can occur zero or more times inside the "note" element.

Declaring Zero or One Occurrences of an Element : 

Declaring Zero or One Occurrences of an Element <!ELEMENT element-name (child-name?)>Example:<!ELEMENT note (message?)> The ? sign in the example above declares that the child element "message" can occur zero or one time inside the "note" element.

Declaring either/or Content : 

Declaring either/or Content Example:<!ELEMENT note (to,from,header,(message|body))> The example above declares that the "note" element must contain a "to" element, a "from" element, a "header" element, and either a "message" or a "body" element.

Slide 25: 

Catalog.css CATALOG { background-color: #ffffff; width: 100%; } CD { display: block; margin-bottom: 30pt; margin-left: 0; } TITLE { color: #FF0000; font-size: 20pt; } ARTIST { color: #0000FF; font-size: 20pt; } COUNTRY,PRICE,YEAR,COMPANY { display: block; color: #000000; margin-left: 20pt; }

Slide 26: 

<?xml version="1.0" encoding="ISO-8859-1"?><?xml-stylesheet type="text/css" href="cd_catalog.css"?><CATALOG>  <CD>    <TITLE>Empire Burlesque</TITLE>    <ARTIST>Bob Dylan</ARTIST>    <COUNTRY>USA</COUNTRY>    <COMPANY>Columbia</COMPANY>    <PRICE>10.90</PRICE>    <YEAR>1985</YEAR>  </CD>  <CD>    <TITLE>Hide your heart</TITLE>    <ARTIST>Bonnie Tyler</ARTIST>    <COUNTRY>UK</COUNTRY>    <COMPANY>CBS Records</COMPANY>    <PRICE>9.90</PRICE>    <YEAR>1988</YEAR>  </CD></CATALOG>