PHP
  Home arrow PHP arrow Page 3 - Data Exchange with XML, WDDX and PHP
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Data Exchange with XML, WDDX and PHP
By: Vikram Vaswani, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2001-09-13


    Table of Contents:
  • Data Exchange with XML, WDDX and PHP
  • The Wonderful World Of WDDX
  • Polly Wants A Cracker
  • Humbert Redfinch-Northbottom The Third, I Presume?
  • Old Friends And New
  • Hip To Be Square
  • The Truth Is Out There
  • Money Talks
  • Closing Time

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Data Exchange with XML, WDDX and PHP - Polly Wants A Cracker
    ( Page 3 of 9 )

    Since WDDX data follows the basic rules of XML markup, it can easily be validated against a DTD. And if you look at the DTD, you'll quickly see that all WDDX "packets" are constructed in a standard format.

    The root, or document, element for WDDX data is always the <wddxPacket> element, which marks the beginning and end of a WDDX block.

    <wddxPacket version='1.0'>
    This is immediately followed by a header containing comments,

    <header> <comment>Who da man?</comment> </header>
    and a data area containing the XML representation of the data structure.

    <data> ... </data> </wddxPacket>
    This data area can contain any of WDDX's basic datatypes, which are described in detail in the WDDX DTD - here's the short version, with examples:

    Boolean values, represented by the element <boolean> - for example

    <wddxPacket version='1.0'> <header/> <data> <struct> <var name='validUser'> <boolean value='true'/> </var> </struct> </data> </wddxPacket>
    Numbers, represented by the element <number> - for example

    <wddxPacket version='1.0'> <header/> <data> <struct> <var name='page'> <number>76</number> </var> </struct> </data> </wddxPacket>
    String values, represented by the element <string> - for example

    <wddxPacket version='1.0'> <header/> <data> <struct> <var name='phrase'> <string>Polly wants a cracker</string> </var> </struct> </data> </wddxPacket>
    Arrays and hashes (or associative arrays), represented by the elements <array> and <struct> respectively - for example

    <wddxPacket version='1.0'> <header/> <data> <struct> <var name='desserts'> <array length='5'> <string>apple pie</string> <string>angel food cake</string> <string>chocolate fudge</string> <string>strawberries and cream</string> <string>tiramisu</string> </array> </var> </struct> </data> </wddxPacket>
    Tabular data, represented by the element <recordset> - for example

    <wddxPacket version='1.0'> <header/> <data> <recordset rowCount="2" fieldNames="symbol, price"> <field name="symbol"> <string>HDST</string> <string>BDGF</string> </field> <field name="price"> <number>56.78</number> <number>373.03</number> </field> </recordset> </data> </wddxPacket>
    Timestamps, represented by the element <dateTime> - for example

    <wddxPacket version='1.0'> <header/> <data> <struct> <var name='today'> <dateTime>2001-08-08T16:48:23</dateTime> </var> </struct> </data> </wddxPacket>


     
     
    >>> More PHP Articles          >>> More By Vikram Vaswani, (c) Melonfire
     

       

    PHP ARTICLES

    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek