1 / 9

XML (Extensible Markup Language)

XML (Extensible Markup Language). Prepared by: Jaclyn Soh. XML (Extensible Markup Language). a language for describing structured data. improves on the HTML approach & makes the web a better place in which to do a business, to learn, and to have fun.

Download Presentation

XML (Extensible Markup Language)

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. XML (Extensible Markup Language) Prepared by: Jaclyn Soh

  2. XML (Extensible Markup Language) • a language for describing structured data. • improves on the HTML approach & makes the web a better place in which to do a business, to learn, and to have fun. • have a freedom to use pretty much any names you like to tag up your data.

  3. Example <!-- HTML Snippet --> <h1>Invoice</h1> <p>From: Jaclyn Soh <p>To: Whoever <p>Amount: $100.00 <p>Tax: 21% <p>Total Due: $121.00 View in .html <!-- XML Snippet --> <Invoice> <From>Jaclyn Soh</From> <To>Whoever</To> <Date>Year=‘2001’ month=‘4’ day=’16’/> <Amount currency = ‘Dollars’>100.00 </Amount> <TaxRate>21</TaxRate> <TotalDue currency = ‘Dollars’>121.00 </TotalDue> </Invoice> View in .xmlfrom .xml to .html

  4. XML – Cont. • any language based on XML consists of a set of element types that have been given certain names & certain meanings. • the presence of elements of various types in documents is indicated by tags that serve to indicate where the element starts and ends. • a set of element types serves to define types of documents and are referred to as Document Type Definitions, or DTD.

  5. XSL – Extensible Stylesheet Language • Extensible Stylesheet Language (XSL) • relationship between XML and XSL is similar to the relationship between HTML and CSS. • example

  6. More XML… • strictly hierarchical. • can have only one root element. Example: <Invoice> document, the <Invoice> element is called root element. • root element is the top-level element in the document, and all the other elements are its children or descendents.

  7. XML – Generosity??? • indeed! XML is very generous in the names we’re allowed to use. For example, there aren’t any reserved words to avoid in XML, as there are in most programming languages. We have a lot flexibility in this regard. • However…

  8. Some rules to follows: • names can start with letters (including non-Latin characters) or the “_” character, but not numbers or other punctuation characters. • after the first character, numbers are allowed, as are the characters “_” and “.”. • names can’t contain spaces. • names can’t contain the “:” character. • names can’t start with letters “xml”, in uppercase, lowercase, or mixed. • there can’t be a space after the opening “<“ character; the name of the element must come immediately after it. • case sensitive. • For example, <first> is different from <FIRST>

  9. Questions • XML is used for describing structural data. (T/F) • XML document can have more than one root element. (T/F) • XML is not case sensitive. (T/F) • XML allows you to create your own tags to precisely describe data. (T/F) • Names can start with letters, characters, numbers and punctuation. (T/F)

More Related