Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to XML Chien-Chung Shen CIS, UD

Similar presentations


Presentation on theme: "Introduction to XML Chien-Chung Shen CIS, UD"— Presentation transcript:

1 Introduction to XML Chien-Chung Shen CIS, UD cshen@cis.udel.edu

2 What is XML XML = eXtensible Markup Language A text-based markup language much “like” HTML Designed to transport/store data, not to display data XML tags are not predefined - you must define your own tags (for your specific applications) XML is designed to be self-descriptive

3 What is XML Identify data using tags (identifiers enclosed in angle brackets: ) Collectively, the tags are known as markup XML tags identify the data rather than specify how to display it An XML tag acts like a field name - specifying the semantics (meaning) of the data

4 Difference between XML and HTML XML is not a replacement for HTML XML and HTML were designed with different goals: –XML was designed to transport and store data, with focus on what data is –HTML was designed to display data, with focus on how data looks HTML is about displaying information, while XML is about carrying information Try http://www.cis.udel.edu/~cshen/367/html.html

5 XML Does Not Do Anything XML was created to structure, store, and transport information The following example is a note to Alice, from Bob, stored as XML: Alice Bob Greetings Happy New Year of the Sheep!!! Self-descriptive Just information wrapped in tags – someone has to write some software to send, receive or display it

6 Tags and Attributes Tags can also contain attributes — additional information included as part of the tag itself, within the tag’s angle brackets <message to=“you@yourAddress.com” from=“me@myAddress.com” subject=“XML is cool”> Let me tell you why... attribute name = attribute value

7 With XML You Invent Your Own Tags XML has no predefined tags - tags in the example above (like and ) are not defined in any XML standard; these tags are "invented" by the author of the XML document Tags used in HTML are predefined - HTML documents can only use tags defined in the HTML standard

8 XML is Not a Replacement for HTML XML is a complement to HTML In most web applications, XML is used to transport data, while HTML is used to format and display the data XML is a software- and hardware- independent tool for carrying (transport/store) information e.g., Simple Object Access Protocol (SOAP) uses XML ( http://en.wikipedia.org/wiki/SOAP )

9 Use of XML for Android AndroidManifest.xml - Every application must have this file (with precisely that name) in its root directory, which presents essential information about the application to the Android system Declare UI elements in XML - Android provides a straightforward XML vocabulary (tags) that corresponds to the View classes and subclasses, such as those for widgets and layouts


Download ppt "Introduction to XML Chien-Chung Shen CIS, UD"

Similar presentations


Ads by Google