11
Overview of XML Mini-Primer David E. González BSEE, MBA

Overview of XML Mini-Primer

Embed Size (px)

DESCRIPTION

Overview of XML Mini-Primer. David E. González BSEE, MBA. What Is XML. XML is an acronym that stands for e X tensible M arkup L anguage. XML like HTML is a “dialect” of what I call “The Mother of All Markup Languages “ – SGML (Standard Generalized Markup Language) - PowerPoint PPT Presentation

Citation preview

Page 1: Overview of XML Mini-Primer

Overview of XMLMini-Primer

David E. GonzálezBSEE, MBA

Page 2: Overview of XML Mini-Primer

What Is XMLXML is an acronym that stands foreXtensible Markup Language.

XML like HTML is a “dialect” of what I call “The Mother of All Markup Languages “ – SGML (Standard Generalized Markup Language)

There has also been the advent of HTML code that has the best of both worlds, which is commonly referred to as XHTML, eXtensible Hypertext Markup Language or HTML5.

Here too XHTML must be “Well-Formed” in order to be properly processed. Latest release is version 1.1

NOTE: XML is not a programming “language” in the truest sense, but a Markup Language. It is many times also referred to a XML Technology

Page 3: Overview of XML Mini-Primer

Anatomy of Example XML File<?xml version="1.0“ encoding="ISO-8859-1"?><?xml-stylesheet href=“workorder.xsl" type="text/xsl"?><?DOCTYPE workorder SYSTEM “workorder.dtd"?> <workorder priority=“ “ datedue=“ “> <submitter> <name first=“ “ last=“ “ /> <email> </email> <account number=“ “ /> </submitter> <project title=“ “> <url> </url> <description> </description> </project></workorder>

Based on Source: http://webdesign.about.com/library/weekly/aa092401a.htm

Prolog

Root TagElement Tag

Element Tag

Child Tags of “project” tag

Child Tags of “submitter” tag

Prolog - This section is the most important of the xml document. Tells browser or parser what to do with this document and what type of document this is (xml) & encoding used.Root tag – It’s the top-element, think of it as a bucket where you put in all your content. There is only one insatnce with opening and closing tagsElement tag – Hierarchy of elements and sub-elements arranged in a logical manner.

StylesheetValidation

Declaration

Page 4: Overview of XML Mini-Primer

Example of An XML File

<?xml version="1.0“ encoding="ISO-8859-1"?><?xml-stylesheet href=“workorder.xsl" type="text/xsl"?><?DOCTYPE workorder SYSTEM “workorder.dtd"?> <workorder priority="high" datedue="09/30/2001"> <submitter> <name first="Jennifer" last="Kyrnin" /> <email>[email protected]</email> <account number="11001100" /> </submitter> <project title="update aa051198.htm article"> <url>http://webdesign.about.com/library/weekly/aa051198.htm</url> <description> Please convert this article to the new article look and feel, with the side navigation and info. </description> </project></workorder>

Modified from Source: http://webdesign.about.com/library/weekly/aa092401a.htm

Here’s how the “skeleton” xml file looks like when filled with content.NOTE: Attributes as part of the Elements tags…

Page 5: Overview of XML Mini-Primer

XHTML<?xml version=“1.0” encoding=“UTF-8”?><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “DTD/xhtml1-strict.dtd”><html xmlns=http://www.w3c.org/1999/xhtml xml:lang=“en” lang=“en”><head><title>Example XHTML Code</title></head><body><p><font size=“3”>Maria Roberts</font></p><p>< font size=“3”>12-11-1942</font></p>

Page 6: Overview of XML Mini-Primer

XML vs. HTML

The major difference between HTML and XML is that XML code must be validated with an XML parser in order to be considered “Well-Formed.”

In this respect XML is closer in behavior its parent language (SGML)

XML was Designed to Describe DataHTML was Designed to Display Data

XML Decouples Data From Presentation

http://courses.cs.vt.edu/~cs1204/XML/htmlVxml.htmlhttp://www.techrepublic.com/blog/10-things/10-things-you-should-know-about-html5/

Page 7: Overview of XML Mini-Primer

XML FamilyTechnologies

XML Namespace:• Display (Browser)o XHTMLo XSLTo XSLo XSL-FOo SVG

• Modeling (Validation)o XML Schemao DTDo RDF

• Manipulation (Parse)o DOMo SAXo XMLTask

• Querying (Database)o XLinko XQLo XPath

XHTML – eXtensible HyperText Markup LanguageXSLT – eXtensible Stylesheet Language TransformationXSL – eXtensible Stylesheet LanguageXSL-FO – eXtensible Stylesheet Language - Formatting ObjectsSVG – Scalable Vector GraphicsXSD - XML Schema DTD – Document Type DefinitionRDF – Resource Description FrameworkDOM – Document Object ModelSAX – Simple API for XMLXMLTask – Uses Apache Ant XLink – XML LinkXQL – XML Query LanguageXPath - XML Path http://www.xml.com/lpt/a/1297

Page 8: Overview of XML Mini-Primer

Benefits of XML*• Simplicity• Openness• Application & Platform Neutral • Extensibility• Self-description• Contains machine-readable context information• Separates content from presentation• Supports multilingual document & Unicode• Facilitates the comparison & aggregation of data• Can embed multiple data types• Can embed existing data• Provides a “one-server view” for distributed data• Rapid adoption by industry

* Reference: http://www.mulberrytech.com/papers/HowAndWhyXML/slide009.html

There are over 100+ different XML dialects and growing. For example, Industry uses xml services or SOAP to exchange data and information. Enterprise level services use ebXML and integrates to ERP (Enterprise resource Planning) systems. Microsoft (Visual Studio) uses XML technologies as the backbone for their products. Android application are developed in WML & WAP (both XML dialect). Oracle has their own native XML functionality (> 10g). And the list goes on and on…

Page 9: Overview of XML Mini-Primer

How These Can Fit

Namespaces – Gives you the ability to create and use different vocabularies in XML

URI - Uniform Resource IdentifierUsed to avoid namespace collision. This is of great importance when usingNamespaces

Page 10: Overview of XML Mini-Primer

Why I’m HereI’m getting up to speed with Perl, but would like to learn Python.

It’s appears to be the most popular coding language out there.

Page 11: Overview of XML Mini-Primer

Thank You

And Yes…XML does work in both Mac & Windows Environment.Even UNIX and other platforms – Truly Portable & Open