3. 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. What is XML ??
• EXtensible Markup Language
• Markup language much like HTML
• Designed to describe data
• Xml tags are not predefined
6. Difference b/w XML&HTML
XML HTML
XML was designed to describe data and to
focus on what data is.
HTML was designed to display data and to
focus on how data looks.
XML allows the author to define his own
tags
The tags used to markup HTML
documents and the structure of HTML
documents are predefined
7. Rules
• All xml elements must have a closing tag
• Xml tags are case sensitive
• All xml elements must be properly nested
• All xml documents must have a root tag
• Attribute values must always be quoted
8. Usages
• XML can keep data separated from your HTML
• XML can be used to store data inside HTML
documents(Data Island)
• XML can be used as a format to exchange
information
• XML can be used to store data in files or in
databases
9. Data Island
• <!DOCTYPE html>
• <html>
• <head>
• <title>XML Data Block Demo</title>
• <!-- this is the data block which contains the XML data -->
• <script id="purchase-order" type="application/xml">
• <purchaseOrder xmlns="http://example.mozilla.org/PurchaseOrderML">
• <lineItem>
• <name>Line Item 1</name>
• <price>1.25</price>
• </lineItem>
• <lineItem>
• <name>Line Item 2</name>
• <price>2.48</price>
• </lineItem>
• </purchaseOrder>
• </script>
• <script>
• function runDemo() {
• // the raw XML data can be retrieved using this...
• var orderSource = document.getElementById("purchase-order").textContent;
10. // the XML data can be parsed into a DOM tree using the DOMParser API...
var parser = new DOMParser();
var doc = parser.parseFromString(orderSource, "application/xml");
var lineItems = doc.getElementsByTagNameNS("http://example.mozilla.org/PurchaseOrderML", "lineItem");
var firstPrice = lineItems[0].getElementsByTagNameNS("http://example.mozilla.org/PurchaseOrderML", "price")[0].textContent;
document.body.textContent = "The purchase order contains " + lineItems.length + " line items. The price of the first line item is " + firstPrice
+ ".";
}
</script>
</head>
<body onload="runDemo()";>
Demo did not run
</body>
</html>
12. A real world example-weather
telecasting
• RDF(resource description framework)
o Framework for writing xml based languages to describe
information on the web
• RSS
o Implementation of RDF
o Website publishers can use RSS to make content available as
a “feed”, so that web users can access some of their contents
without actually visiting their site.
14. Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many contents online?
Do you want to learn things quickly?
Tired of spending huge amount of money to become a Software professional?
Do an online course
@ baabtra.com
We put industry standards to practice. Our structured, activity based courses are so designed
to make a quick, good software professional out of anybody who holds a passion for coding.
15. Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ slideshare.net/BaabtraMentoringPartner
Connect to us @ in.linkedin.com/in/baabtra
Give a feedback @ massbaab.com/baabtra
Thanks in advance
www.baabtra.com | www.massbaab.com |www.baabte.com
16. Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Cafit Square,
Hilite Business Park,
Near Pantheerankavu,
Kozhikode
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com
Contact Us