Hi, played quite a bit with pyxb a bunch of weeks ago, in order to do something like $subject - from a set of simplistic template documents, generate an enumeration of schema-valid variations along several dimensions of an xsd schema. The background here was generating suites of test documents for the OpenOffice.org xml import filters (ooxml and odf). The general concept is not too different from what e.g. the generator from Java's multi-schema- validator (msv) does.
All of that is on http://gitorious.org/pyxb (with the meat inside the ooxml-example branch) - but the initial question of course would be, if this specific kind of thing would be generally useful for pyxb - and the natural next question, would the way of me hacking (mostly) the binding classes to support iterating document values be the best/an acceptable way of doing it? Current state of affairs roughly looks like this (and I wouldn't exactly call it nice, nor elegant): _TypeBinding_mixin got an iterateBinding()/_iterateBinding_vx() pair, and the primitive datatypes each got a _fuzz_vx(). The latter performs pseudo-random variations on the data value (in a way that should usually remain schema-valid), whereas simpleTypeDefinition.iterateValue() just tries all available facets' fuzzing for retrieving a new, overall-valid data value. Visiting binding objects is currently controlled via a rather ad-hoc regex matcher - but hey, it makes up for a rather terse document generator, in e.g. pyxb/examples/ooxml-strict/demo.py (see test.sh in that dir for how it's used). ;) Feedback, thoughts, constructive criticism greatly appreciated! :) Cheers, -- Thorsten
pgpWZ9d3UdepZ.pgp
Description: PGP signature
------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________ pyxb-users mailing list pyxb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyxb-users