0
Disclaimer: This presentation is prepared by trainees ofbaabtra as a part of mentoring program. This is not officialdocume...
XMLZabeeb Anwarzabeebanwar@gmail.comwww.facebook.com/zabeeba  nwartwitter.com/zabeebanwarin.linkedin.com/in/zabeeb+9198955...
XML• eXtensible Markup Language• XML is a meta markup language for text  documents / textual data.• XML allows to define l...
XML EXAMPLE<article>  <author>Gerhard Weikum</author>  <title>The Web in 10 Years</title></article>• Easy to understand fo...
THIS IS ALSO XML<data> ch37fhgks73j5mv9d63h5mgfkds8d984lgnsmcns983</data>• Impossible to understand for human users• Not e...
• The actual benefit of using XML highly  depends on the design of the application.
Quick Comparison                                           XMLuses tags and attributes           HTML                     ...
XML schema• The purpose of an XML Schema is to define the legal building  blocks of an XML document, just like a DTD.• An ...
XML Documents Form a Tree Structure• XML documents must contain a root element.  This element is "the parent" of all other...
XML Syntax Rules•   All XML Elements Must Have a Closing Tag•   XML Tags are Case Sensitive•   XML Elements Must be Proper...
• What is a parser?  – A program that analyses the grammatical  structure of an input, with respect to a given  formal gra...
• <article>  <author>Gerhard Weikum</author>  <title>The Web in 10 Years</title> </article>Easy to understand for human u...
What is a XML Parser?• It is a software library (or a package) that  provides methods (or interfaces) for client  applicat...
• We will consider two parsing methods     SAX = Simple API for XML     DOM = Document Object Model
SAX• XML is read sequentially• When a parsing event happens, the parser  invokes the corresponding method of the  correspo...
DOM• Parser creates a tree object out of the  document• User accesses data by traversing the tree  – The tree and its trav...
Glade XML Structure• It represents an `instantiation of an XML interface  description. When object is created, the XML fil...
GladeXMLObject HierarchyGObject +---- GladeXMLtypedef struct {   GObject parent;   char *filename; }GladeXML;
GladeXMLClasstypedef struct{   GObjectClass parent_class;  /* Virtual function: gets the appropriate gtype for  the typena...
If this presentation helped you, please visit our           page facebook.com/baabtra and like it.               Thanks in...
Contact Us
Xml
Upcoming SlideShare
Loading in...5
×

Xml

126

Published on

XML

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
126
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "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. XMLZabeeb Anwarzabeebanwar@gmail.comwww.facebook.com/zabeeba nwartwitter.com/zabeebanwarin.linkedin.com/in/zabeeb+919895599689
  3. 3. XML• eXtensible Markup Language• XML is a meta markup language for text documents / textual data.• XML allows to define languages (applications) to represent text documents / textual data
  4. 4. XML EXAMPLE<article> <author>Gerhard Weikum</author> <title>The Web in 10 Years</title></article>• Easy to understand for human users• Very expressive (semantics along with the data)• Well structured, easy to read and write from programs
  5. 5. THIS IS ALSO XML<data> ch37fhgks73j5mv9d63h5mgfkds8d984lgnsmcns983</data>• Impossible to understand for human users• Not expressive (no semantics along with the data)• Unstructured, read and write only with special programs
  6. 6. • The actual benefit of using XML highly depends on the design of the application.
  7. 7. Quick Comparison XMLuses tags and attributes HTML uses tags and attributes- content and formatting can - content and format are be placed together separate; formatting is <p><font=”Arial”>text</font> contained in a stylesheet- tags and attributes are pre- - allows user to specify what determined and rigid each tag and attribute means
  8. 8. XML schema• The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD.• An XML Schema: – defines elements that can appear in a document – defines attributes that can appear in a document – defines which elements are child elements – defines the order of child elements – defines the number of child elements – Etc.
  9. 9. XML Documents Form a Tree Structure• XML documents must contain a root element. This element is "the parent" of all other elements.• The elements in an XML document form a document tree. The tree starts at the root and branches to the lowest level of the tree.
  10. 10. XML Syntax Rules• All XML Elements Must Have a Closing Tag• XML Tags are Case Sensitive• XML Elements Must be Properly Nested• XML Documents Must Have a Root Element• XML Attribute Values Must be Quoted• White-space is Preserved in XML
  11. 11. • What is a parser? – A program that analyses the grammatical structure of an input, with respect to a given formal grammar
  12. 12. • <article> <author>Gerhard Weikum</author> <title>The Web in 10 Years</title> </article>Easy to understand for human usersVery expressive (semantics along with the data) Well structured, easy to read and write from programs
  13. 13. What is a 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
  14. 14. • We will consider two parsing methods SAX = Simple API for XML DOM = Document Object Model
  15. 15. SAX• XML is read sequentially• When a parsing event happens, the parser invokes the corresponding method of the corresponding handler
  16. 16. DOM• Parser creates a tree object out of the document• User accesses data by traversing the tree – The tree and its traversal conform to a W3C standard• The API allows for constructing, accessing and manipulating the structure and content of XML documents
  17. 17. Glade XML Structure• It represents an `instantiation of an XML interface description. When object 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.• The GladeXML object can also be used to connect handlers to the named signals in the description.• Libglade provides an interface by which it can look up the signal handler names in the programs symbol table and automatically connect as many handlers up as it can.
  18. 18. GladeXMLObject HierarchyGObject +---- GladeXMLtypedef struct { GObject parent; char *filename; }GladeXML;
  19. 19. GladeXMLClasstypedef struct{ GObjectClass parent_class; /* Virtual function: gets the appropriate gtype for the typename.*/ GType (* lookup_type) (GladeXML*self, const char *gtypename);} GladeXMLClass;
  20. 20. 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
  21. 21. Contact Us
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×