Sean said:
I'm a self taught PHP, MySQL developer with a little knowledge of
javascript...
Looking to add some more knowledge to my resume. What is XML, and what
can it do for me? What are it's main functions and uses? Where does it
add speed? What kind of applications can it build?
Thanks for you comments and help!
That's a big question and I'm sure everyone has their own viewpoint.
XML is just a file format that you can use to store data or transfer it from
somewhere to somewhere else - Think of it as like a glorified 'ini file' if
you like.
However, it has several advantages over many other file formats, here are
some:
1. It can store hierarchically nested information to an arbitrary depth and
with attributes on any of the elements
2. values can be of arbitrary size - no line length restrictions
3. the character set used is known (either implicitly or stated explicitly)
4. the 'namespace' feature means that different types of information can be
present in the same XML "document" without conflicting with each other.
5. there are standard mechanisms for escaping certain character sequences
6. the 'dtd' and 'schema' features allow you to specify what is allowed
where, so the document can be automatically validated by a standard tool
7. there are many tools available to process XML - you don't have to use a
different tool for different file formats
Taken by itself, XML is nothing magical. However, what makes it great is
that you can use one file format for so many things.
Whenever you design your own file format or data transfer format you have to
invent your own conventions (how to represent a comment, how to represent
the end of a line, which character set will it be in, how to escape certain
characters) and you have to write your own tools to access it.
However, if you choose to use XML, you have many of these low-level problems
solved and many tools already available. once you are using XML for a lot of
things you will find yourself using the same tools and programming libraries
to solve many different problems, and if you have to interchange data with
someone else's application a lot of the "protocol" issues don't apply
because you're both talking XML
Although I knew what XML was before I started to use it, I was skeptical
because I thought "it's just a file format". Now I use it all the time I'm
much more convinced of the benefits.
As to your exact questions, XML cannot by itself add speed or build
applications; it is just a universal language that can be used to store and
interchange information and is increasingly becoming *THE* language for
those things.
Andy