<message>
<from> http://www.my-company.com
</from>
<to> http://www.your-company.com
</to>
<content>
<schema>
http://www.explanations.com/record </schema>
<employee>
<name> John </name>
<supervisor> Mary </supervisor>
</employee>
</content>
</message>
What the schema
part does is point to an address on the Web, i.e. http://www.explanations.com/record, where the receiving computer
will find the definition of what an employee record is. This will help the receiving
computer understand the message. In the same way, if your local utility wants
to send you an invoice for electricity, it puts in the letter the word “Invoice”
so that you know that the numbers in the letter mean that you must pay them. In
our case here, the receiving computer just needs to follow the Web link
indicated by the schema to understand that the ensuing information is a record.
Indeed, the way
the receiving computer figures out that it is receiving an employee record is
by going to http://www.explanation.com/record. There, it finds the description
of an employee record; actually, the same description that we encountered
previously:
<record>
<title> employee </title>
<element> name </element>
<element> supervisor </element>
</record>
Therefore, the
receiving computer now understands how to interpret the message it just
received. It now knows that what it received is an employee record made of the
name of an employee and the name of the supervisor. Here we see the power of
using the network not only to send and receive messages, but also to understand
their content.
The fact to
remember here is that XML information can be distributed, since the record and
its description can be in different parts of the network. That’s why we say
that XML is the first language allowing one to do totally distributed
computing, which is the computer geek’s way of saying that we use several
computers at once to perform a task. That very property is what makes services
delivered over the Web possible on a grand scale.
Let’s say now
that the computer receiving the message whose content is:
<employee>
<name> John </name>
<supervisor> Mary </supervisor>
</employee>
wants to answer,
say, by providing new content:
<employee>
<name> John </name>
<supervisor> Suzan </supervisor>
</employee>
hereby
indicating that John now has a new boss, Suzan, in place of Mary.
What the first
computer needs is a way to find the supervisor name in the first message, and
then to change that supervisor name. Computers do this as follows:
|