Re: non-textual types

Eyal Lewinsohn <jlewinso@netvision.net.il>

> what i want is that if the following exists in an XML document
> <size dt:dt="int">14</size> in the DOM tree i want have "14"
> not as text but as in integer.

If you're into serialisation of structured, non-necessarily-text
types you may want to look at WDDX (http://www.wddx.org/), an
application of XML that will happily encode characters, integers,
real numbers, heterogeneous lists and [dictionaries/mappings/
hashes/whatever your language calls it].

Judging from your previous post however, you're using C++; AFAIK
there are currently no C++ bindings for WDDX.

Also, if I interpret you correctly, you want to store objects'
instance data in XML, which is also something I'm interested in
as it would allow desktop editing applications to use XML as
their native file format. WDDX does not go quite this far.

[The following is somewhat off-topic, since it is xml-related
but not www-related.]

I would like to see an application of XML to do this, whilst
supporting backward compatibility by giving a class name and
version number to each class/superclass of an object, and
allowing applications that do not understand the object's
class to step up the class hierarchy to find the most
specific object that they *can* understand.

For example, say in a sound sequencer (an application I've been
working on in my head for ages but never got around to writing)
there was an EchoEffect object representing an echo of 50% of
the original sound, at a 100ms delay, which went on for 1 second.
The saved file could look something like -

  <object>
    <class name="Effect" version="1">
      <member name="length">
        <real>1.0</real>
      </member>
    </class>
    <class="EchoEffect" version="2">
      <member name="delay">
        <real>0.1</real>
      </member>
      <member name="strength">
        <real>0.5</real>
      </member>
    </class>
  </object>

Obviously this is considerably simplified, and only has real
number object properties, where they might be any of the
structured types WDDX features, or indeed other <object>s,
but it shows the point: if the application was an older
version that didn't know what "EchoEffect" was, it would
at least know that it was an effect of some kind and it
was 1 second long. The application could happily move the
effect about, edit the properties related to the Effect
superclass, and save the file, without stamping on the
EchoEffect object.

Does anyone know of any similar efforts to serialise
object hierarchies together with their class hierarchies
like this?

-- 
Andrew Clover
Technical Support
1VALUE.com AG

Received on Friday, 28 April 2000 08:21:29 UTC