web developer & system programmer

coder . cl

ramblings and thoughts on programming...


comparing pyxser and jsonx

published: 30-04-2011 / updated: 30-04-2011
posted in: development, programming, projects, pyxser
by Daniel Molina Wegener

If you are a pyxser user, you may know that it uses a standard and structured serialization model. It was designed on January of 2009, and his target from that date until today is to generate a universal serialization model, so it can be ported to other languages easily, and maintain its more interesting features, like cross reference and circular reference serialization capability.

At other side, JSONx is an IBM standard that has as main purpose to build XML representation of JSON objects. It is using a model very similar to the pyxser model, but restricted to JSON supported data types, so it is not extensible like pyxser. It only supports objects, arrays, booleans, strings, numbers, and nulls. The pyxser side is quite simple, it has objects, collections and plain properties. Objects can hold other objects, collections and properties; collections can hold other objects and properties and properties can hold only plain text data types, but flexible enough to create a custom serialization and hold a Base 64 encoded binary string and similar stuff.

JSONx Structure

JSONx Structure

JSONx is more complex than pyxser. It is doing the same mistakes than other serializers, since it holds the data type on the XML element itself. Instead, pyxser is doing the task of placing the data type and namespace on separate attributes. The data type is stored on the type attribute and the namespace is stored on the module attribute. We can talk about JSONx as domain specific XML serialization, at the pyxser side, we can talk as domain abstraction serialization model.

PyXSer Structure

JSONx Structure

The JSONx model is not available through public XML Schema, its XML Schema is held inside IBM products. You can search for the pyxser XML Schema here, on its public URL: pyxser XML Schema, and the serialization model implementation is available for the Python language as Python Extension (a module written in C) and you can find it here: pyxser. The JSONx reference can be found here: JSONx. Also you can find pyxser XML document definitions in the form of XML schemas and DTD, and it is distributed with the pyxser Python extension:

Understanding the pyxser XML Schema will drive you to understand its abstraction model. So, have fun implementing domain abstraction, instead of doing domain specific XML serializations.


No coments yet.

post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>