Archives

Web Page Width and Fixed vs. Fluid Designs (current)

What is XML, Why and How Is It Used? (June 11, 2008)

Web Careers: Job Titles and Skills (January 15, 2008)

What is XHTML? (December 15, 2007)

AJAX and Spry (September 18, 2007)

HTML 5 and XHTML 2.0? (July 20, 2007)

HTML Reference - Learn HTML Tags (April 6, 2007)

Amazing Internet/Web Advancements (March 26, 2007)

Web Design and Development Process (March 24, 2007)

Firefox, FoxIt, TerraGen, and Expression Web (March 5, 2007)


Web Tips and News

Bookmark this web page to keep up on the latest news and techniques in web development.

What is XML, Why and How Is It Used?   Posted: June 11, 2008

What is XML?

  • XML stands for eXtensible Markup Language (Extensible meaning features can be added to it; it is a generic markup language to begin with and can be customized and extended/added to).
  • It is an open standard for structuring information.
  • It is the World Wide Web Consortium’s (W3C) recommended standard for creating formats and sharing data on the Web.
  • It can be used to exchange data between programs written in different languages, running on different operating systems, located on computers anywhere in the world.
  • Sample XML code for a Catalog of books (contains two elements).
  • One can think of an XML file as a database table, and each element as a record in the table, such as a movie in an inventory table, a part in a parts table, or an employee in an employees table. Author, title, and genre, etc. would then be considered fields.

    

  • XML documents must have a root element, which in this example is . The developer makes these up to be whatever he/she wants. Root (parent) element has child elements, i.e. author, price, etc. These could have attributes. And the data displayed, just like in HTML, are values.
  • A second example: http://www.w3schools.com/XML/plant_catalog.xml

Why use XML / Where is XML used?

  • We’ve used XML to bring utilize external and potentially frequently changing content inside of Flash web site files (thus you do not need to re-modify the compiled/executable Flash SWF output file). This example is at: http://www.hfccwebclub.com/ice/photos/ (each photo gallery links to an external XML file with the catalog of images in the gallery – images are also external).
  • An auto maker may want to develop and agree on a standard XML format to receive inventory/parts information in from all of its various suppliers (i.e. suppliers send auto maker data based on auto makers XML standard format).
  • XML data can be exported out of and imported into many software applications, such as Microsoft Excel and Microsoft Access.
  • Databases (Enterprise RDBMSs - Oracle, IBM DB2, Microsoft SQL Server, MySQL) are a natural use for XML, because XML is all about data. External XML data can be imported into or exported out of the database.
  • XML is what the HTML version – XHTML – is based off of. XHTML is eXtensible.
  • XML is used by RSS news feeds, i.e. RSS is based on XML.
  • XMLNews is a standard used for exchanging news information.
  • XML is used to publish weather information from the national weather service/NOAA (National Oceanic and Atmospheric Administration).
  • Many companies are moving to XML to write their internal documentation. The most common XML platform for this is DocBook.
  • Microsoft Office 2007 documents are now all XML-based! .docx, .xlsx, .pptx are all XML-based. Did you know you can now open up an MS Word 2007 document with WinZip? Yes – it is a file containing many other files all stored separated within the .docx file. WinZip will show you these files and allow you to extract the individual pieces, i.e. text, images, etc. one at a time.
  • The Winamp music/media (Mp3) player software program used XML for its skins, playlists, and SDK. http://www.winamp.com/development/skins-modern-simple2
  • SOAP (Simple Object Access Protocol) is based off of XML. SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages. It used extensively in Web Services. SOAP is a way to create widely distributed, complex computing environments that run over the Internet using existing Internet infrastructure. SOAP is about applications communicating directly with each other over the Internet in a very rich way. SOAP is used in B2B and many jobs requests SOAP knowledge.
  • Any other imaginable use for any specific purpose or corporate need involving data.
    • XML is the basis for SML, or Spacecraft Markup Language, that is used by the space community.
    • This should not be confused with the other SML, Simple Markup Language, an approach to simplify XML to make life easier for XML-consuming devices.
  • adXML is used by the advertising industry for both online and offline media. adXML is an XML specification of the type of information that is passed between a purchasing and selling agent of advertising inventory. adXML addresses both the worlds of online and off-line (e.g., print, magazines, TV) advertising.
  • LandXML was developed by several companies (AutoDesk, etc.) to store data on land visualizations. It is used by the U.S. Federal Highway System Administration to produce safer road designs. It has support for the U.S. Federal Aviation Administration projects. It is used in many other land development and transportation projects.
  • Petroleum eXtensible Markup Language (PetroXML) has been designed to connect the disparate accounting and EDI systems of petroleum vendors, operating companies, data exchanges and other oil and gas industry companies.
  • When the National Library of Medicine endeavored to modernize its computer systems in the late 1990s/early 2000s, the NLM chose XML (eXtensible Markup Language) as the new tagged format for disseminating its MEDLINE bibliographic citation data.
  • SVG (Scalable Vector Graphics) are an XML-based image format/type. The image is actually produced from pure-text based XML code (i.e. you can edit the image with a text editor). Well-suited to small and handheld devices because of the small file size of SVG files and the memory/storage limits of the devices. Requires a plug-in to view on most PC web browsers.
  • MusicXML is used to store and exchange musical scores and notations. It is supported by lading score writing programs, music OCR programs, music sequencing programs, and free music score software.
  • There are but a *very* few examples. YOU can create your own XML-based markup language, e.g. DML, or Diane’s Markup Language ;-)

How do you work with XML?

  • XML can be interpreted natively by a web browser. It is displayed in a tree-like manner with + and – signs to expand and collapse elements. Example: http://www.w3schools.com/XML/cd_catalog.xml
  • XSL (Extensible Stylesheet Language) and XSLT Extensible Stylesheet Language Transformations) are used to format/display, transform, and query XML document. XSL is to XML what CSS is to HTML. However, both XSL and CSS can be used to format XML for a web page.
  • Could be used an alternative to storing data in a database. This may be more useful if it is a small amount of data that changes frequently on a web page. Store it externally in XML and then format it for the Web with XSL. XML is not practical to replace a large database as the XML file would grow to too large of a file size, consume too much bandwidth, and be slow to process.
  • JavaScript can be used to parse XML for display on a web page, perhaps in an HTML table. This is done via HTML DOM or XML DOM (Document Object Model).
  • XML can be read, parsed and displayed by programming/scripting languages such as PHP, ASP, Python, Perl, and Java, to name a few. (usually via function libraries).
  • XPath is a language used to navigate through elements and attributes and find information in an XML document.
  • XQuery is a W3C language for querying, constructing and transforming XML data.
  • XML is a part of AJAX (Asynchronous JavaScript and XML)
  • The SAX (Simple API for XML) can be used to work with XML. It was the first widely adopted API for XML in Java.
  • XML can be processed using any number XML Transformation Engines, such as the iWAY XML Transformation Engine, the Xalan Transformation Engine, or the XIST XML Transformation Engine.
  • MMLSpy is an XML editor and integrated development environment (IDE) that allows developers to create XML-based and Web services applications using technologies such as XML, XML Schema, XSLT, XPath, XQuery, WSDL, and SOAP. XMLSpy is also available as a plug-in for Microsoft Visual Studio and Eclipse.