XML - why???

F

fletch

Hi, I'm new to all this, I am studying (from scratch) for a new career
in website management. I have been looking all over the internet to
find out why (in English - not jargon!!) xml is used. Is it to make
life simpler for the site designer? Or to help with sending data? If
so, how? And, for ezxample, who would use it and why?
Now I need all the help I can get so I dont mind if you all want to
show off to the newbie!
Fletch
 
H

Hans Oesterholt-Dijkema

One way to look at XML is to see it as a kind of self describing,
canonical syntax that can be used to create e.g. messages or files to
exchange data between applications.

In the past, for each exchange different messaging formats and
syntaxes were agreed on. Now, at least the syntax is nothing to
think about anymore ("let's use XML"). With XML Schemas one can
even tell others how an XML message will be formatted and to a
certain level, what it will contain (typed data).

Now one could think, what's the fuss? Well, take for instance,
soap or XML RPC. Using SOAP to call a service or function from
an other application, one does not need to be aware in which
language the applications are written. As long as they talk XML...


fletch schreef:
 
S

Stefan Ram

Hans Oesterholt-Dijkema said:
Now, at least the syntax is nothing to
think about anymore ("let's use XML").

But, then, the syntax will make one think again: "Should this
be represented by an attribute or a child element?"

And then later, possibly when problems with XML become too
obvious: "After all, maybe we should use some other syntax?"
For example, IIRC, for RSS feeds or RDF other syntaxes are
considered now.
 
S

scooterm

### Plain English Answer

Hi fletch,

You asked for "simple and jargon-free English". Right off the start you
are
in for a challenge, because that's not easy to find (for any
technology).

Here then, is about as simple and jargon-free as you will find
anywhere, and you can come back to this as you progress in experience
with all the uses, practices, annoyances,
and challenges that face you in the future. ...

Ready? Here goes:

1. XML is one way to make it easier to write computer programs that
output and input data.

2. XML is one way to make it easier to indicate the different parts of
any kind of message, in a way that a computer (or rather, a person
writing programs that run on a computer) can easily understand without
making mistakes, and without unwanted ambiguity.

3. XML is not the only way to do these things, but it is a popular way,
and it is one of the few ways that can be done using tools no more
sophisticated than a simple text editor and your favorite computer
programming language.

Apart from this, there are thousands upon thousands of ideas, opinions,
preferences, wars, rumors, debates and innovations that have "XML"
somewhere in the name. In the end, the main "why" that may distinguish
XML from any of its alternatives (and there are many) may be:

4. XML is respected enough to justify putting on your resume; complex
enough to support many different kinds of ideas; broad enough to
support an entire ecosystem of jargon and hype (essential ingredients
for any technology ... if it is going to make money or gain momentum);
and productive enough to offset the time and cost invested in learning
it (at least according to many folks out there).

### Your Homework
And now for your homework:
1. Do the following search on Google (copy it exactly):

site:microsoft.com "what is xml"

2. Read the following article to keep the "hype" in perspective:

http://www.well.com/~doctorow/metacrap.htm

This is more than enough to get you started.
 
S

Stefan Ram

Stefan Ram ([email protected]) wrote:
:And then later, possibly when problems with XML become too
What problems?

Attributes should be properties of what is being described by
an element. For such properties, it would make sense to be
structured and allow multiple values. Both is not possible in
XML. So in the most prominent XML-application, in XHTML, when
a paragraph is to have two classes, even the W3C is leaving
XML for a custom language:

<p class="alpha beta">gamma</p>

Here, the syntax of "alpha beta" is not being described by XML
anymore - it can not be validated by XML that only certain
values ("alpha", "beta", ...) can appear there, it is not
specified by XML, that this is the same:

<p class="beta alpha">gamma</p>

(These classes then have relevancy for CSS, for example).

So the W3C does not use its XML-syntax for all parts of XHTML
- this might suggest "problems".

Because attributes can not be structured, people have to use
either such custom languages or to use child elements to
emulate structured attributes.

Then, of course, there are often notations which are much more
human-readable for specific purposes. For example, computer
programs, often are not written in XML for that reason.
Anyway, I think that RSS is (in theory at least) based on xml formats, and
unless I misunderstand what you are talking about, so is RDF.

I was thinking of Atom - a different format for the
information that also might be send using RSS - and of N3, a
different format for RDF. (The RDF using XML sometimes is
called "RDF/XML".)
 
M

Malcolm Dew-Jones

Stefan Ram ([email protected]) wrote:
: >Now, at least the syntax is nothing to
: >think about anymore ("let's use XML").

: But, then, the syntax will make one think again: "Should this
: be represented by an attribute or a child element?"

Two choices. Compare that to a custom data interchange format - infinite
choices.

Already XML has narrowed the work down considerably.

And once the format is decided then a DTD and/or schema will allow anyone
anywhere to use the format correctly, leaving only the higher level data
validation to be handled in a non-standardized way.

: And then later, possibly when problems with XML become too
: obvious: "After all, maybe we should use some other syntax?"
: For example, IIRC, for RSS feeds or RDF other syntaxes are
: considered now.

What problems? If you need to interchange data you need a format. Any
format will have good points and bad points, and those issues will likely
change over time as other underlying issues change. E.g. the hardware
upon which you run your software - change your hardware and suddenly your
"efficient" binary transfers have compatibility problems. So whatever
problems you claim with xml, I suspect any other format would have
equivalently problematic issues, and all those issues will likely be
replaced by some other issues later on.

In a recent project I had to scrape xml messages from a text log file.
The messages where then re-applied by sending them to a server. The task
was well nigh trivial because the text format and well defined structure
of each message meant they where trivial to reliably pull out even though
the log file was not itself xml, and contained various formats of textual
data. If necessary I could have modified each message if I wanted - again
that work would have been trivial. I suspect I would have earned
considerably more from the project if the messages had been in a binary
format.

Anyway, I think that RSS is (in theory at least) based on xml formats, and
unless I misunderstand what you are talking about, so is RDF.

And there are numerous xml enabled tools to manipulate the data without
writing custom code to do so.
 
P

Peter Flynn

fletch said:
Hi, I'm new to all this, I am studying (from scratch) for a new career
in website management. I have been looking all over the internet to
find out why (in English - not jargon!!) xml is used. Is it to make
life simpler for the site designer? Or to help with sending data? If
so, how? And, for ezxample, who would use it and why?

It's actually got more to do with accuracy in identification of your
information, than directly with web pages or data transmission, although
those are two important uses.

See if the FAQ answers your questions: http://xml.silmaril.ie/
(and let me know if it doesn't).

///Peter
 
D

David Dorward

Stefan said:
I was thinking of Atom - a different format for the
information that also might be send using RSS

Atom is also an XML format, and its design goal is to develop (in public) a
tool that does the job of RSS along with related tasks. RSS suffers rather
from having a dozen different versions, mostly incompatable with each
other, ATOM should be a single format.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,249
Members
46,846
Latest member
BettinaOsw

Latest Threads

Top