internet.com

Go to WebDeveloper Home


hm-v6-139x61.gif

Database Journal: The Knowledge Center for Database Professionals

find a web host with:
CGI Access
DB Support
NT Servers
UNIX Servers
Telnet Access

advanced search
jobs

Get FREE Development Info via your Email!

The Webdeveloper channel
FlashKit
GIF.com
HiermenusCentral
webdeveloper Jobs
Java Boutique
JavaScript.com
JavaScript Source
ScriptSearch
StreamingMedia World
WDJ
WDVL
WebDeveloper.com
WebReference.com
XMLFiles.com

internet.com
Internet News
Internet Investing
Internet Technology
Windows Internet Tech.
Linux/Open Source
Web Developer
ECommerce/Marketing
ISP Resources
ASP Resources
Wireless Internet
Downloads
Internet Resources
Internet Lists
International
EarthWeb
Career Resources

Search internet.com
Advertise
Corporate Info
Newsletters
E-mail Offers

internet.commerce
Be a Commerce Partner










 
THE XML FILES
A WebDeveloper.com Feature

WDDX: A Deeper Look

by Nate Zelnick

A Quick Example

Say you wanted to represent the output of a simple form on a page that collected user information--first name, last name, and birthdate, for instance--the kind of information that is likely to be useful across a whole range of applications. This would be represented in a WDDX "packet". WDDX structures are called packets because the XML representation of the data is only important (generally) as an entity on the wire in the space between apps.

This data would consist of two strings and a date in all languages (or at least all languages that support the concept of a date type). Each variant consists of a name-value pair. This name-value pair relationship is what gives the packet its structure.

Representing an instance of this data might look like this:

<wddxPacket version="0.9">
<header>
</header>
<data>
<var name="firstname">
	<string>Joseph
</var>
<var name="lastname">
	 <string>Josephson
</var>
<var name="birthdate"
	<datetime>12/12/67
</var>
</data>
</wddxPacket>

This doesn't appear to be all that exciting. After all, this kind of flat data is not that rich or complex, and the data itself has next to no inter-relationships. But what if you wanted to deliver a bunch of different people's information and maintain the relationship between all of those firstnames, lastnames and birthdates?

To do this, you need to take the flat data of a single person's data and create a structure that packs multiple records into an array, such that all of the relationships remain intact. Not a particularly hard computer science problem, but tough to do across different languages and platforms on the Web.

To do this you enclose the data in structures:

...{heading info clipped for brevity}

<data>
	<struct>
		<var name="friends">
			<array length=2>
				<array length=3>
					<string>Joseph
					<string>Josephson
					<datetime>12/12/67
				</array>
				<array length=3>
					<string>Ben
					<string>Benson
					<datetime>11/11/27
				</array>
			</array>
		</var>
	</struct>
</data>

This creates a two-dimensional array with three fields that can be used across all of the different platforms above--as long as they support the serializer and deserializer objects that turn native structures into WDDX packets a(nd back again) for the target platform.


Next column, we'll finish this topic off with some sample applications.

Fast Jump to Anywhere on WebDeveloper.com®:



Copyright © 1999-2001 internet.com Corp.
All Rights Reserved. Legal Notices.
Contact the WebDeveloper.com® staff

Last modified: Friday, 22-Aug-2008 13:46:47 EDT

http://www.internet.com

 

Refresh Daily
Join Editor-in-Chief David Fiedler The Editor With No Time and find truth, justice, and a clue or two.


Browse by Category
[ Site Map ]

ActiveX / VBscript
Animated GIF Archive
Browsers
CGI / Perl
Database Connectivity
E-Commerce
HTML-Advanced: DHTML, CSS
HTML / Site Authoring Tools
Intranet/Groupware
Java
JavaScript
Multimedia: Audio / Video / Streaming Technologies
Opinions
Refresh Daily: Editorial Column
Security
Servers & Server Tools
Site Design / Graphics
Site Management / Marketing / Log File Analysis
VRML / 3D
XML