Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
XML


Reshmi R
reshmir@ymail.com
www.facebook.com/reshmi.
  ramaswami
twitter.com/reshmir1
in.linkedin.com/in/reshmi r
+917736719717
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
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
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
• The actual benefit of using XML highly
  depends on the design of the application.
Applications
• Content management
• Data Exchange
• Document Markup

• Etc.
XML Schemas
• “Schemas” is a general term--DTDs are a form
  of XMLschemas
  – According to the dictionary, a schema is “a
    structured framework or plan”
• When we say “XML Schemas,” we usually mean the
  W3C XML Schema Language
  – This is also known as “XML Schema Definition”
    language, or XSD
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.
XML Schema Requirements
• Structural
      – namespaces
      – primitive types & structural schema
      integration
      – inheritance
Data type
  – integers, dates, … (like in languages)
  – user-defined (constrain some properties)
XML PARSER
    A program that analyses the grammatical structure of an input,
      with respect to a given formal grammar.
We will consider two parsing methods that implement W3C standards for
  accessing XML

SAX (Simple API for XML)
    – event-driven parsing
    – “serial access” protocol
    – Read only API

DOM (Document Object Model)
   – convert XML into a tree of objects
   – “random access” protocol
   – Can update XML document (insert/delete nodes)
SAX PARSER
• SAX = Simple API for XML

• XML is read sequentially

• When a parsing event happens, the parser invokes the
  corresponding method of the corresponding handler

• Similar to an I/O-Stream, goes in one direction
DOM PARSER
• DOM = Document Object Model

• 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
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 program's symbol table and
  automatically connect as many handlers up as it can.
GladeXML
Object Hierarchy
GObject +----
 GladeXML

typedef struct {
   GObject parent;
   char *filename; }
GladeXML;
GladeXMLClass
typedef struct
{
   GObjectClass parent_class;
  /* Virtual function: gets the appropriate gtype for
  the typename.*/
  GType (* lookup_type) (GladeXML*self, const char
  *gtypename);
} GladeXMLClass;
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
Contact Us

XMl

  • 2.
    Disclaimer: This presentationis prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3.
    XML Reshmi R reshmir@ymail.com www.facebook.com/reshmi. ramaswami twitter.com/reshmir1 in.linkedin.com/in/reshmi r +917736719717
  • 4.
    XML • eXtensible MarkupLanguage • XML is a meta markup language for text documents / textual data. • XML allows to define languages (applications) to represent text documents / textual data
  • 5.
    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
  • 6.
    THIS IS ALSOXML <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
  • 7.
    • The actualbenefit of using XML highly depends on the design of the application.
  • 8.
    Applications • Content management •Data Exchange • Document Markup • Etc.
  • 9.
    XML Schemas • “Schemas”is a general term--DTDs are a form of XMLschemas – According to the dictionary, a schema is “a structured framework or plan” • When we say “XML Schemas,” we usually mean the W3C XML Schema Language – This is also known as “XML Schema Definition” language, or XSD
  • 10.
    XML Documents Forma 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.
  • 11.
    XML Schema Requirements •Structural – namespaces – primitive types & structural schema integration – inheritance Data type – integers, dates, … (like in languages) – user-defined (constrain some properties)
  • 12.
    XML PARSER A program that analyses the grammatical structure of an input, with respect to a given formal grammar. We will consider two parsing methods that implement W3C standards for accessing XML SAX (Simple API for XML) – event-driven parsing – “serial access” protocol – Read only API DOM (Document Object Model) – convert XML into a tree of objects – “random access” protocol – Can update XML document (insert/delete nodes)
  • 13.
    SAX PARSER • SAX= Simple API for XML • XML is read sequentially • When a parsing event happens, the parser invokes the corresponding method of the corresponding handler • Similar to an I/O-Stream, goes in one direction
  • 14.
    DOM PARSER • DOM= Document Object Model • 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
  • 15.
    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 program's symbol table and automatically connect as many handlers up as it can.
  • 16.
    GladeXML Object Hierarchy GObject +---- GladeXML typedef struct { GObject parent; char *filename; } GladeXML;
  • 17.
    GladeXMLClass typedef struct { GObjectClass parent_class; /* Virtual function: gets the appropriate gtype for the typename.*/ GType (* lookup_type) (GladeXML*self, const char *gtypename); } GladeXMLClass;
  • 18.
    If this presentationhelped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 19.