#native_company# #native_desc#

WDDX Functions in PHP

By Jess M. Castagnetto
on July 30, 2000

I’ve had text lying around from when we were writing the book (1) last year, and the people at Wrox gave they OK for
the information to be put as articles in PHPBuilder.com, so here it is the
first one of a series.


The Extensible Markup Language (XML), is a metalanguage that allows the
definition of markup languages. It is not a markup language in itself, but you
can think of it as providing the construction rules for specialized languages
used for data description. XML is not the new generation HTML, it is more
oriented to be used in data applications in which the data and its rendition
are separated. HTML mixes data description with data rendering, i.e. it has
tags like <TITLE> mixed with tags such as <B>.
XML is more like SGML-lite (I am stretching the comparison here), and similar
to the DSSSL technology used in SGML for document rendering, it has several
options that the developer can use to generate a displayable document (CSS,
XSL, etc.). XML allows us to create our own “tags” to better
describe our data, and by using a DTD (a Document Type Definition) that
describes the structure and valid content of our documents, we can
easily perform validations on a document using general tools.
When we define our own tags (a DTD), we are making an “XML application”, i.e.
we are applying the rules of the XML specification to define a particular class of
documents. The HTML DTD could be considered in this context an XML application,
except that it does not comply in toto with strict XML. A better example would be
the DocBook XML DTD, which is being used to create documentation in several
Open Source projects (the PHP manual, the Linux Documentation Project, etc.)
As a first approximation we can use XML for a creating letters, chapters of
books, articles, etc. Or we can use it in the context of data storage and
retrieval (an XML based database for example).
In this article I will focus on using XML documents for data encapsulation. Wrapping our data in XML
clothes will allow for different applications, running in separate servers,
to be able to pass complex information back and forth over HTTP connections.