On Aug 26, 10:02 pm, Stefan Behnel <stefan...@behnel.de> wrote: > Josh English, 27.08.2010 01:30: > > > solve a lot of the problems I'm running into in my own attempt to > > build a python Class implementation of an XML Validation object. > > How would object serialisation help here? > >
I'm running into the same problem in a lot of projects I'm working on. I can't decide one the best way to serialize instances of classes. I want to be able to store these instances in a human-readable and editable format that I can reload back into their objects. The XML validation tool requires the rules of the XML to be written out in Python as classes and instances. I would love to have a consistent way to write the definition file and load it. For example, Relax NG can be written out, the rules loaded into a parser, and actual XML data can be validated against it. Since I started in Python, I want that bridge back to serialization. In this project, and others, subclassing plays a big role in using the code, so I need a reliable way of writing a definition, loading it into the proper subclass, and running with those subclasses. I am familiar with XML, but I've played with YAML and may try that. I'm hesitant to use YAML because it requires that I add the YAML.object. I even wrote a program to store data similar to GEDCOM format, which seemed the simplest from a user's perspective. Josh -- http://mail.python.org/mailman/listinfo/python-list