SlideShare ist ein Scribd-Unternehmen logo
1 von 17
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(XML Schema,XML Parsing, Glade XML Structure)
XML

• XML stands for eXtensible Markup Language
• XML was designed to carry data, not to
  displayData
• XML tags are not predefined. You must define
  your own tags
Main Components of an XML
             Document

Elements: <hello>

Attributes: <item id=“33905”>

Entities: &lt; (<)
The Basic Rules
•   XML is case sensitive
•   All start tags must have end tags
•   Elements must be properly nested
•   XML declaration is the first statement
•   Every document must contain a root element
•   Attribute values must have quotation marks
•   Certain characters are reserved for parsing
Common Errors for Element
           Naming
• Do not use white space when creating names
  for elements
• Element names cannot begin with a digit,
  although names can contain digits
• Only certain punctuation allowed – periods,
  colons, and hyphens
XML Schema Basics
• XML Schema is an XML application
• Provides simple types (string, integer, dateTime, duration,
  language, …)
• Allows defining possible values for elements
• Allows defining types derived from existing types
• Allows defining complex types
• Allows posing constraints on the occurrence of elements
• Allows forcing uniqueness and foreign keys
• Way too complex to cover in an introductory talk
Simplified XML Schema Example
<xs:schema>
 <xs:element name=“article“>
   <xs:complexType>
     <xs:sequence>
       <xs:element name=“author“ type=“xs:string“/>
       <xs:element name=“title“ type=“xs:string“/>
       <xs:element name=“text“>
         <xs:complexType>
              <xs:sequence>
                <xs:element name=“abstract“ type=“xs:string“/>
              <xs:element name=“section“ type=“xs:string“
                               minOccurs=“0“ maxOccurs=“unbounded“/>
              </xs:sequence>
         </xs:complexType>
       </xs:element>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
</xs:schema>
XML Parser
• An XML parser converts an XML document into an XML DOM object -
  which can then be manipulated with JavaScript
• A DOM (Document Object Model) defines a standard way for accessing
  and manipulating documents
The XML DOM
• The XML DOM defines a standard way for accessing and manipulating
  XML documents
• The XML DOM views an XML document as a tree-structure
• All elements can be accessed through the DOM tree. Their content (text
  and attributes) can be modified or deleted, and new elements can be
  created. The elements, their text, and their attributes are all known as
  nodes
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;
Parse an XML Document
Note:
Internet Explorer uses the loadXML() method to parse an XML
string, while other browsers use the DOMParser object.
GladeXML
Allows dynamic loading of user interfaces from XML descriptions.
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.
The GladeXML object can also be used to connect handlers to the named
   signals in the description. Libglade also 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 that way.
Usage
Class: <glade-xml>
   Derives from <gobject>.
This class defines no direct slots.
— Function: glade-xml-new (fname mchars) (root mchars) (domain mchars) 
  ⇒  (ret <glade-xml>)
  Creates a new GladeXML object (and the corresponding widgets) from the
  XML file fname. Optionally it will only build the interface from the widget
  node root (if it is not ‘#f’). This feature is useful if you only want to build
  say a toolbar or menu from the XML file, but not the window it is
  embedded in. Note also that the XML parse tree is cached to speed up
  creating another GladeXML object for the same file
fnamethe XML file name.
   rootthe widget node in fname to start building from (or ‘#f’)
   domainthe translation domain for the XML file (or ‘#f’ for default)
   retthe newly created GladeXML object, or NULL on failure.
Usage

Method: get-widget
  This function is used to get a pointer to the
  GtkWidget corresponding to name in the interface
  description. You would use this if you have to do
  anything to the widget after loading.
selfthe GladeXML object.
  namethe name of the widget.
  retthe widget matching name, or ‘#f’ if none exists.
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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Xml dom
Xml domXml dom
Xml dom
 
Python xml processing
Python   xml processingPython   xml processing
Python xml processing
 
XSLT presentation
XSLT presentationXSLT presentation
XSLT presentation
 
Tool Development 04 - XML
Tool Development 04 - XMLTool Development 04 - XML
Tool Development 04 - XML
 
Sax parser
Sax parserSax parser
Sax parser
 
PhD Presentation
PhD PresentationPhD Presentation
PhD Presentation
 
Tool Development 05 - XML Schema, INI, JSON, YAML
Tool Development 05 - XML Schema, INI, JSON, YAMLTool Development 05 - XML Schema, INI, JSON, YAML
Tool Development 05 - XML Schema, INI, JSON, YAML
 
Extracting data from xml
Extracting data from xmlExtracting data from xml
Extracting data from xml
 
XML SAX PARSING
XML SAX PARSING XML SAX PARSING
XML SAX PARSING
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
 
03 x files
03 x files03 x files
03 x files
 
00 introduction
00 introduction00 introduction
00 introduction
 
Xslt by asfak mahamud
Xslt by asfak mahamudXslt by asfak mahamud
Xslt by asfak mahamud
 
Xml basics
Xml basicsXml basics
Xml basics
 
XML XSLT
XML XSLTXML XSLT
XML XSLT
 
Xml processing in scala
Xml processing in scalaXml processing in scala
Xml processing in scala
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
XML for beginners
XML for beginnersXML for beginners
XML for beginners
 
XML and XSLT
XML and XSLTXML and XSLT
XML and XSLT
 

Andere mochten auch (6)

Java exeception handling
Java exeception handlingJava exeception handling
Java exeception handling
 
XML
XMLXML
XML
 
Flowchart& algorithom
Flowchart& algorithomFlowchart& algorithom
Flowchart& algorithom
 
Stack and heap
Stack and heapStack and heap
Stack and heap
 
MIS
MISMIS
MIS
 
Html tags
Html tagsHtml tags
Html tags
 

Ähnlich wie XML (20)

XMl
XMlXMl
XMl
 
Xml
XmlXml
Xml
 
Xml processing in scala
Xml processing in scalaXml processing in scala
Xml processing in scala
 
CTDA Workshop on XML and MODS
CTDA Workshop on XML and MODSCTDA Workshop on XML and MODS
CTDA Workshop on XML and MODS
 
Xml and xml processor
Xml and xml processorXml and xml processor
Xml and xml processor
 
Xml and xml processor
Xml and xml processorXml and xml processor
Xml and xml processor
 
Ch23
Ch23Ch23
Ch23
 
Ch23 xml processing_with_java
Ch23 xml processing_with_javaCh23 xml processing_with_java
Ch23 xml processing_with_java
 
XML
XMLXML
XML
 
XML notes.pptx
XML notes.pptxXML notes.pptx
XML notes.pptx
 
Xml parsing
Xml parsingXml parsing
Xml parsing
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
XML Presentation-2
XML Presentation-2XML Presentation-2
XML Presentation-2
 
Xml
XmlXml
Xml
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
Java XML Parsing
Java XML ParsingJava XML Parsing
Java XML Parsing
 
Web Service Workshop - 3 days
Web Service Workshop - 3 daysWeb Service Workshop - 3 days
Web Service Workshop - 3 days
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
 
Xsd
XsdXsd
Xsd
 
Xsd
XsdXsd
Xsd
 

Mehr von baabtra.com - No. 1 supplier of quality freshers

Mehr von baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Kürzlich hochgeladen

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Kürzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

XML

  • 1.
  • 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
  • 3. XML(XML Schema,XML Parsing, Glade XML Structure)
  • 4. XML • XML stands for eXtensible Markup Language • XML was designed to carry data, not to displayData • XML tags are not predefined. You must define your own tags
  • 5. Main Components of an XML Document Elements: <hello> Attributes: <item id=“33905”> Entities: &lt; (<)
  • 6. The Basic Rules • XML is case sensitive • All start tags must have end tags • Elements must be properly nested • XML declaration is the first statement • Every document must contain a root element • Attribute values must have quotation marks • Certain characters are reserved for parsing
  • 7. Common Errors for Element Naming • Do not use white space when creating names for elements • Element names cannot begin with a digit, although names can contain digits • Only certain punctuation allowed – periods, colons, and hyphens
  • 8. XML Schema Basics • XML Schema is an XML application • Provides simple types (string, integer, dateTime, duration, language, …) • Allows defining possible values for elements • Allows defining types derived from existing types • Allows defining complex types • Allows posing constraints on the occurrence of elements • Allows forcing uniqueness and foreign keys • Way too complex to cover in an introductory talk
  • 9. Simplified XML Schema Example <xs:schema> <xs:element name=“article“> <xs:complexType> <xs:sequence> <xs:element name=“author“ type=“xs:string“/> <xs:element name=“title“ type=“xs:string“/> <xs:element name=“text“> <xs:complexType> <xs:sequence> <xs:element name=“abstract“ type=“xs:string“/> <xs:element name=“section“ type=“xs:string“ minOccurs=“0“ maxOccurs=“unbounded“/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
  • 10. XML Parser • An XML parser converts an XML document into an XML DOM object - which can then be manipulated with JavaScript • A DOM (Document Object Model) defines a standard way for accessing and manipulating documents The XML DOM • The XML DOM defines a standard way for accessing and manipulating XML documents • The XML DOM views an XML document as a tree-structure • All elements can be accessed through the DOM tree. Their content (text and attributes) can be modified or deleted, and new elements can be created. The elements, their text, and their attributes are all known as nodes
  • 11. 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;
  • 12. Parse an XML Document Note: Internet Explorer uses the loadXML() method to parse an XML string, while other browsers use the DOMParser object.
  • 13. GladeXML Allows dynamic loading of user interfaces from XML descriptions. 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. The GladeXML object can also be used to connect handlers to the named signals in the description. Libglade also 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 that way.
  • 14. Usage Class: <glade-xml> Derives from <gobject>. This class defines no direct slots. — Function: glade-xml-new (fname mchars) (root mchars) (domain mchars)  ⇒  (ret <glade-xml>) Creates a new GladeXML object (and the corresponding widgets) from the XML file fname. Optionally it will only build the interface from the widget node root (if it is not ‘#f’). This feature is useful if you only want to build say a toolbar or menu from the XML file, but not the window it is embedded in. Note also that the XML parse tree is cached to speed up creating another GladeXML object for the same file fnamethe XML file name. rootthe widget node in fname to start building from (or ‘#f’) domainthe translation domain for the XML file (or ‘#f’ for default) retthe newly created GladeXML object, or NULL on failure.
  • 15. Usage Method: get-widget This function is used to get a pointer to the GtkWidget corresponding to name in the interface description. You would use this if you have to do anything to the widget after loading. selfthe GladeXML object. namethe name of the widget. retthe widget matching name, or ‘#f’ if none exists.
  • 16. 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