Version 13 of WDDX

Updated 2005-10-06 12:01:12

WDDX: Web Distributed Data Exchange, or WDDX, is a free, open XML-based technology that allows Web applications created with any platform to easily exchange data with one another over the Web.

For more info, See http://www.openwddx.org/ .

Are there any WDDX-parsers for TCL?


Example packet #1:

  <wddxPacket version='1.0'>
    <header comment='Example WDDX packet' />
    <data>
      <string>This is WDDX packet example</string>
    </data>
  </wddxPacket>

Example packet #2:

  <wddxPacket version='1.0'>
    <header comment='Another example' />
    <data>
      <struct>
        <var name='pi'>
          <number>3.1415926</number>
        </var>
        <var name='cities'>
          <array length='3'>
            <string>Austin</string>
            <string>Novato</string>
            <string>Seattle</string>
          </array>
        </var>
      </struct>
    </data>
  </wddxPacket>

LV Based on this example,WDDX appears to be a specific application of XML. There are a couple of XML extensions for Tcl - tdom and tclxml at the very least.

I'm uncertain what one would need to use with either of these to be considered a WDDX parser.


schlenk 2005-10-06 Based on the description of WDDX it seems like a serialization protocol for application data. As Tcl does not really have most of the types of for example Java or C one would have to create a mapping from WDDX to Tcl Data structures, probably something like struct::record or one of the OO packages. With tdom and some XPath expression it should be quite straightforward to do once you decide on a mapping.

Based on a short look at the wddx dtd from the openwddx link above, i can say doing WDDX with Tcl will be quite straight forward. I must also say it doesn't look like the best specification, the authors seem to not understand XML whitespace handling correctly.

NEM is slightly confused about that <array length='3'> bit. Surely the length is easily available by just counting the number of children nodes, which should be trivial with any XML parser. And what if the length specified and the number of child nodes differ? Too much C-coding leaking into the spec?


Category Glossary Category Internet