1 / 9

Introduction to XML

Introduction to XML. Chien -Chung Shen CIS, UD cshen@cis.udel.edu. What is XML. XML = e X tensible M arkup L anguage A text-based markup language much “like” HTML Designed to transport/store data, not to display data

oni
Download Presentation

Introduction to XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. What is XML • XML = eXtensibleMarkup Language • A text-based markup language much “like” HTML • Designed to transport/storedata, 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 carryinginformation • Try http://www.cis.udel.edu/~cshen/367/html.html

  5. XML Does Not DoAnything • XML was created to structure, store, and transport information • The following example is a note to Alice, from Bob, stored as XML: <note> <to>Alice</to> <from>Bob</from> <subject>Greetings</subject> <body>Happy New Year of the Snake!!!</body> </note> • 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”> <text>Let me tell you why ... </text> </message> • attribute name = attribute value

  7. With XML You Invent Your Own Tags • XML has no predefined tags - tags in the example above (like <to> and <from>) 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

More Related