1 / 18

What is XML ?

What is XML ?. e X tensible M arkup L anguage A subset of SGML (Standard Generalized Markup Language) Mechanism to identify structures in a document Markup language for documents containing structured information Self-Descriptive Buzz Word. XML and HTML. Similar in nature <tags>

Download Presentation

What is 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. What is XML? • eXtensible Markup Language • A subset of SGML (Standard Generalized Markup Language) • Mechanism to identify structures in a document • Markup language for documents containing structured information • Self-Descriptive • Buzz Word

  2. XML and HTML • Similar in nature • <tags> • Labels • Elements • <tags> plus content • Reference Specification • WWW consortium (W3C) • HTML transitional • XHTML • XML 1.0

  3. XML Document Structure • Declaration • Elements • Attributes • Character Data • Processing Instructions • Comments • Entity References

  4. Declaration <xml version=“1.0” encoding=“iso-8859-1”> • Start of the file • Optional • Future proof

  5. Elements <Report> XML Report </Report> • Highest level termed as the root element • Contains: • Start tag • Some Content • End tag

  6. Attributes <Report Author=“Stevie”> XML Report </Report> • Contains: • Name • Value

  7. Character Data <Report Author=“Stevie”> <type>XML </type> Report </Report> • Element Content • Special Symbols • ‘&’ and ‘<‘ • See Entity References

  8. Comments <!-- This is a Comment -->

  9. Entity References

  10. Processing Instructions <?, and end with the string ?> • Show a processing instruction at the appropriate place in the node tree (DOM) • Firing a processing instruction event (SAX)

  11. Well-Formed XML • Tags must be nested properly • All start tags must have end tags • Use quotation marks properly for tag attributes • Use entity references

  12. Document Type Definition • Set of rules • May be included in the document itself • May be linked externally • Confirming to a DTD • Well-formed • valid

  13. Document Type Definition * <!DOCTYPE rootElementName [ …insert declarations here… ]> * <!Element element (sub1, sub2,…,subn)> * <!ATTLIST element name (value1|value2)

  14. XML Parsing • Document Object Model (DOM) • Simple API for XML (SAX)

  15. Document Object Model (DOM) • Document Model driven • Build a tree model of the elements in the document • Allow for application to access the tree • DOM XML parser • Converts XML documents into Java Tree object model

  16. Simple API for XML (SAX) • Event driven • SAX XML parser processes elements serially • XML application provides callback functions to handle elements

  17. Freely Available XML Parsers • Apache Software Foundation Xerces XML Parser (xml.apache.org) • Open source • Oracle XML Parser Version 2 (www.oracle.com/xml) • Must register • SAX2 Parser (www.megginsion.com/SAX) • Freely available

  18. References • http://www.w3.org/XML • http://www.xml.com • http://www.w3schools.com/xml/default.asp

More Related