The introductions
These brief introductions to XQuery and Ajax fill you in on what you need
to know to get started.
A brief introduction to
XQuery
It's this simple: XQuery is to an XML document what Structured Query
Language (SQL) is to a relational database. XQuery enables you to
use expressions to extract data from an XML document. That data can include
one simple value or an entire subtree of the document, such as an element
and all of its children.
To accomplish this, XQuery uses XPath expressions, which involve the famous
"FLWOR" expressions. These expressions provide a powerful means of
extracting and returning data from XML documents in almost any fashion
imaginable.
The syntax of the language is based on the tree-like nature of the XML
document itself. XQuery is aware of processing instructions and attributes
as well as elements.
Please note that for XQuery to function properly, the XML document being
queried must be well formed, but not necessarily valid. Recall that a
well-formed XML document means that it conforms to the World Wide Web
Consortium's (W3C's) XML standard. (See Resources for more information.) An XML document is valid
when it conforms to its own Document Type Definition (DTD) or schema.
A brief introduction to
Ajax
Ajax is one of the latest bleeding-edge technologies Web developers use to
enable rich client presentation. It accomplishes this by invoking a new
request without disrupting the current view. An XML document is returned
that is then displayed to the user, frequently as a sub-page within the
current presentation. In short, Ajax gives you the benefit of server-side
dynamic content while still looking like client-side dynamic content.
Ajax generally fulfills its billing through the use of the XMLHttpRequest
Document Object Model (DOM) API, which—until the advent of
Ajax—Web developers rarely used. The request itself can
be either one of the GET or POST varieties. As with any other request, a response is
returned, which can be an error. If the response is not erroneous, the
actual text of the response is used to update the current view.
Remembering a famous statement by Voltaire (namely, "The Holy Roman Empire
was neither holy, nor Roman, nor an empire"), thorough research into
various Ajax implementations leads one to realize that Ajax does not
require JavaScript code, does not require XML, and does not need to be
asynchronous. After stripping all of that out, the only part left in the
acronym is the conjunction and. But the acronym sounds cool, so the
industry has decided to keep it.
|