Xml

287 views

Published on

XML

  • Be the first to comment

  • Be the first to like this

Xml

  1. 1. Disclaimer: This presentation is prepared by trainees ofbaabtra as a part of mentoring program. This is not officialdocument of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .Ltd
  2. 2. eXtensible Markup Language
  3. 3. BASIC POINTS ABOUT XML• XML allows data to be stored in either elements or attributes.• Elements and attributes can be named to give the data meaning.• Start tags and end tags define elements that are the basis for XML tree-structured representations of documents.• Elements can contain text data and/or other elements.
  4. 4. XML ADVANTAGES• XML files are human-readable . Such is not the case with binary data formats• Widespread industry support exists for XML. Numerous tools and utilities are being provided with Web browsers, databases, and operating systems, making it easier and less expensive for small and medium-sized organizations to import and export data in XML format.
  5. 5. • Major relational databases now have the native capability to read and generate XML data.• A large family of XML support technologiesis availablefor the interpretation and transformation of XML data for Web page display and report generation.
  6. 6. COMPARISON XML HTML• Extensible set of tags • Fixed set of tags• Content orientated • Presentation oriented• Standard Data • No data validation infrastructure capabilities• Allows multiple • Single presentation• output forms
  7. 7. XML-RELATED TECHNOLOGIES• DTD(Document Type Definition) and XML Schemas are used to define legal XML tags and their attributes for particular purposes• CSS(Cascading Style Sheets) describe how to display HTML or XML in a browser.• XSLT (eXtensible Stylesheet Language Traformations) and Xpath are used to translate from of xml to another
  8. 8. OVERALL STRUCTURE• An XML document may start with one or more processing instructions(PI) or directives:• <?xml version =“1.0”?>• <?xml-stylesheet type=“text/css” href=“ss.css”• Following the directives,there must be excatly one tag, called the root element,containing all the rest of the XML:• <weatherReport> ………</weatheReport>
  9. 9. XML SCHEAMS• “Schemas” is a general term--DTDs are a form of XML schemas• When we say “XML Schemas,” we usually mean the W3C XML Schema Language• DTDs, XML Schemas, and RELAX NG are all XML schema languages
  10. 10. Why XML Schemas?• DTDs provide a very weak specification language• DTDs are written in a strange (non-XML) format• The XML Schema Definition language solves these problems
  11. 11. XML PARSER• It is a software library (or a package) that provides methods (or interfaces) for client applications to work with XML documents• It checks the well-formattedness• It may validate the documents• It does a lot of other detailed things so that a client is shielded from that complexities
  12. 12. Parse an XML Document• The following code fragment parses an XML document into an XML DOM object if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","books.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML
  13. 13. Parse an XML String• The following code fragment parses an XML string into an XML DOM object:• txt="<bookstore><book>"; txt=txt+"<title>Everyday Italian</title>"; txt=txt+"<author>Giada De Laurentiis</author>"; txt=txt+"<year>2005</year>"; txt=txt+"</book></bookstore>"; if (window.DOMParser) { parser=new DOMParser(); xmlDoc=parser.parseFromString(txt,"text/xml"); } else // Internet Explorer { xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.loadXML(txt); }
  14. 14. GladeXMLObject HierarchyThis object represents an `instantiation of an XML interface description. When one of these objects is created, the XML file is read, and the interface is created. The GladeXML object then provides an interface for accessing the widgets in the interface by the names assigned to them inside the XML description.GObject +---- GladeXML
  15. 15. GladeXMLtypedef struct { GObject parent; char *filename; }GladeXML;
  16. 16. GladeXMLClasstypedef struct { GObjectClass parent_class; /* Virtual function: gets the appropriate gtype for the typename.*/ GType (* lookup_type) (GladeXML*self, const char *gtypename); } GladeXMLClass;
  17. 17. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance.www.baabtra.com | www.massbaab.com |www.baabte.com
  18. 18. Contact Us

×