0
I Use This!
Activity Not Available
Analyzed over 1 year ago. based on code collected over 8 years ago.

Project Summary

The xobj project provides an object reflector between various dynamic languages and XML. Currently, python and ActionScript 3 implementations are available.

The source tree is available as a Mercurial repository at http://hg.rpath.com/xobj/

Motivationsxobj was motivated by a few specific goals:

Make the use of XML for object model interchange between client and server tiers less painful Allow your code to use real typed instances of classes rather than simple generic data structures Treat your code as the definition of schema rather than forcing an XMLSchema driven approach on your code. Read and write XML documents that will pass most XMLSchema structural validation requirements with relatively little effort on your part It is not required to provide an XML schema to use xobj. Custom objects may be used for parts or all of the document, whether or not an XML schema is provided. Schema validation is optional. If new elements show up, they will be preserved across read/write; schema additions will not normally require code changes.

Implementation NotesDuring XML decoding, xobj preserves namespaces, element ordering and tracks attributes vs elements so that re-encoded object graphs can comply with most of the common XMLSchema validation requirements. This observed metadata is attached to your object graph rather than hidden out of view.

For "whole cloth" generation of XML from object graphs that were not themselves decoded in the first place, you can provide the namespace, elements ordering and attribute metadata declaratively to facilitate XMLSchema conformance.

During decoding, xobj uses both the runtime type information available from your classes as well as a typemap you specify to determine the target type for every decoded XML element.

During encoding, xobj uses this same runtime information plus additional observed (or provided) metadata to inform the output XML.

For ActionScript, xobj decodes XML documents directly into typed instance objects rather than generic Object or ObjectProxy wrappers. This avoids the double-handling of generic objects required by the default SimpleXMLDecoder provided by Adobe Flex.

ExamplesFor example, using the ElementTree Python library, you might write something like this:

imageItem = x for x in parent if x.tag='image'
In this case, imageItem will always be a list, even if it is not defined in the XML schema to be a sequence.

Using xobj, you could refer to the image element more directly:

parent.image
That will be either a single item or a list, depending on the context. Additionally, the image object will be of a class you specify.

The unit test cases provide further examples of usage and intended semantics of the xobj methods.

Tags

actionscript as3 flex python xml

MIT License
Permitted

Commercial Use

Modify

Distribute

Sub-License

Private Use

Forbidden

Hold Liable

Required

Include Copyright

Include License

These details are provided for information only. No information here is legal advice and should not be used as such.

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    use of OSS increased in 65% of companies in 2016
  • ...
    compare projects before you chose one to use
  • ...
    65% of companies leverage OSS to speed application development in 2016
  • ...
    check out hot projects on the Open Hub

Languages

Languages?height=75&width=75
XML
59%
ActionScript
20%
XML Schema
7%
7 Other
14%

30 Day Summary

Nov 20 2012 — Dec 20 2012

12 Month Summary

Dec 20 2011 — Dec 20 2012
  • 97 Commits
    Down -50 (34%) from previous 12 months
  • 5 Contributors
    Down -5 (50%) from previous 12 months