Home arrow XML arrow XML Basics
XML

XML Basics


When I first heard about XML, I thought it was something similar to HTML. Needless to say, I was wrong. XML and HTML were designed with different goals. XML was designed to describe data and HTML was designed to display data. In this article we will try to learn some basics about XML. Then we will learn about DTD and XML schemas.

Author Info:
By: Mamun Zaman
Rating: 4 stars4 stars4 stars4 stars4 stars / 43
September 05, 2007
TABLE OF CONTENTS:
  1. · XML Basics
  2. · XML Tags and Conventions
  3. · More on Elements
  4. · XML Schema

print this article
SEARCH DEVARTICLES

XML Basics
(Page 1 of 4 )

XML stands for eXtensible Markup Language. XML is used to aid the exchange of data. The language makes it possible to define data in a structured way. XML tags are not predefined like HTML. XML lets you create your own unique tags that are meaningful for your data, hence the use of the term "extensible."

An XML document does not do anything by itself. It is just pure information wrapped in tags. You have to write a piece of software to send, receive or display it. XML is recommended by the World Wide Web Consortium (W3C). 

Using XML, data can be exchanged between incompatible systems. One of the biggest challenges for developers has been to exchange data between different systems over the Internet. By converting the data to XML, developers can greatly reduce this complexity and create data that can be understood by different types of applications.

XML is a meta-language. A meta-language is a language that's used to define other languages. You can use XML, for instance, to define a language like WML. XML is also used in SOAP and WSDL. XML has become popular to use with web services.

<?xml version="1.0" ?>
<bookstore>
  <book>
    <title id="1">XPath Tutorial</title>
    <author>Mamun Zaman</author>
    <year>2007</year>
    <price>00.99</price>
  </book>
  <book>
    <title id="2">AJAX Tutorial</title>
    <author>Charles</author>
    <year>2007</year>
    <price>03.45</price>
  </book>
</bookstore>

Above is an example of an XML document. The first line of this document is the processing instruction which indicates it is an XML document. This XML declaration also defines the XML version. In this case the document conforms to the 1.0 specification of XML.

An XML document must have a root element. Here <bookstore> is the root element. In the above XML example, <book> is a tag and has 4 child elements title, author, year and price. The <title> tag has an attribute named "id." Attributes are name-value pairs.


blog comments powered by Disqus
XML ARTICLES

- 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 
Support 

Developer Shed Affiliates

 




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