XML

   

XML (eXtensible Markup Language) is a universal format for transferring data across the Internet. On the surface, XML files are simply text files. However, this is oversimplifying things. The beauty in XML is that XML files themselves contain not only data, but self-describing information (metadata) about the data. The fact that XML files are text files makes it relatively easy to move them across boundaries (such as firewalls) and platforms.

graphics/newterm.gif

Semantic tags are used to describe data in an XML file, and a starting and ending tag are used to define an element. The data between a starting and ending tag is the value of the element. Tags are similar to HTML tags and have the following format:

 <  tagname  >  data  </  tagname  > 

For example, you could store a color in an element titled BackColor, like this:

 <BackColor>Blue</BackColor> 

It's important to note that XML tags are case sensitive; therefore, BackColor is not the same as backcolor, and both elements could exist in the same XML file.

Elements can be nested as long as the starting and ending tags of elements don't overlap. For example, two customers could be stored in an XML file like this:

 <Customer>    <Name>John Smith</Name>    <OrderItemID>Elder Scrolls: Morrowind</OrderItemID>    <Price>.00</Price> </Customer> <Customer>    <Name>Jane Aroogala</Name>    <OrderItemID>Ultima VII: The Black Gate</OrderItemID>    <Price>.00</Price> </Customer> 

XML files can be much more complex, but this simple example should suffice to show you that XML documents are text documents that can store just about any type of data you can think of. In fact, Microsoft is using XML in just about everything, from ADO.NET to XML Web services.


   
Top


Sams Teach Yourself C# in 24 Hours
Sams Teach Yourself Visual Basic 2010 in 24 Hours Complete Starter Kit (Sams Teach Yourself -- Hours)
ISBN: 0672331136
EAN: 2147483647
Year: 2002
Pages: 253
Authors: James Foxall

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net