Home arrow XML arrow Page 3 - XML Basics - Part One

XML Basics - Part One

XMLDo you cringe when you hear the words "XML"?  Are you just not sure what the heck this acronym is all about?  Not to worry!  In this article, Liviu introduces us to XML, the various ways it can be created and parsed, as well as a brief introduction to XML and the way it came to be.

Author Info:
By: Liviu Tudor
Rating: 5 stars5 stars5 stars5 stars5 stars / 84
December 15, 2003
  1. · XML Basics - Part One
  2. · Brief History of Data Exchange
  3. · The Need for XML
  4. · DTD, Schema and Valid XML
  5. · DTD

print this article

XML Basics - Part One - The Need for XML
(Page 3 of 5 )

Just like humans, computer programs were puzzled when they “spoke” different languages – and since every single company insisted on using their own language, there was a need for common ground – neutral to all the existing ones, but which can be adapted – to serve all these languages.

That’s where XML stepped in – through it’s (nearly) unbound structure, it allows us to describe most (if not all) data formats known in such a manner that it can be understood by other XML-enabled programs without the need for these programs to be aware of the actual contents of the file.  Even more so, XML doesn’t limit you to representing only one type of data (e.g. word processor, spreadsheets, vector graphics etc.) – you can represent anything with XML, assuming you have defined a “grammar” to do so.  Also, as there are XML parsers for nearly every single programming language, plugging XML into your application is (nearly) an easy task; and as long as the program you are exporting data for can parse XML, it should be able to understand your data.  Note the term “should” in the previous sentence!

Let’s consider one example: suppose you write a program to export employee file details from your HR system in XML.  A typical “record” in XML could look like this:

<Employee name=”Liviu” surname=”Tudor” birthday=”14/02/1975”/>

This is a valid XML tag – it declares an element of type Employee, which has three attributes: name, surname and birthday. All other programs that need to read such data will look for an Employee tag and read these 3 attributes.  However, take the following one:


It is a valid structure and it represents the same data! Even more so, try to interpret this data in the USA (the author of this article is based – at the moment – in Europe, where the data format is day/month/year) and you’ll find out that such a birth date is invalid!

If that is the case, how would another application that needs to make use of this data “know” how to interpret it and make sure that this information is valid – and therefore no errors would be input into the system?

blog comments powered by Disqus

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials