Chinese chess (Xiang Qi) is one of the most popular board games worldwide,
being played by approximately one billion people in China, Taiwan,and wherever Chinese have settled.
Having a long history, the modern form of Chinese chess was popular during the Southern Song Dynasty (1127–1279 A.D.).
... [More]
The earliest record of a Chinese-chess game and a book on the theory of the game originates from that time. [Less]
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:
... [More]
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. [Less]
Epoche lexer is a scanner of C source files. It is intended to be used in lexical analysis of C source programs. Aim is to generate a high quality scanner that will detect lexical errors in C source code and provide clear diagnostic messages.
This site uses cookies to give you the best possible experience.
By using the site, you consent to our use of cookies.
For more information, please see our
Privacy Policy