2. 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
4. 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.
5. 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.
6. • 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.
7. 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
8. 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
9. 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>
10. 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
11. 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
12. 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
13.
14. 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
15. 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);
}
16. GladeXML
Object Hierarchy
This 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
18. GladeXMLClass
typedef struct
{
GObjectClass parent_class;
/* Virtual function: gets the appropriate gtype for
the typename.*/
GType (* lookup_type) (GladeXML*self, const char
*gtypename);
} GladeXMLClass;
19. 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