stochastic
stochastic

Reputation: 3413

python: how to define types for conversion to xml

I am implementing a parser in python 2.7 for an xml-based file format. The format defines classes with fields of specific types.

What I want to do is define objects like this:

class DataType1(SomeCoolParent):
    a = Integer()
    b = Float()
    c = String()
    #and so on...

Caveats/Notes

Upvotes: 0

Views: 451

Answers (1)

tdelaney
tdelaney

Reputation: 77337

There a several XML Schema specifications out there. My knowledge is somewhat dated but XML Schema (W3C) - a.k.a. XSD and relax ng are the most popular with relax ng having a lower learning curve. With that in mind, a good ORM (or would that be OXM 'Object-XML Mapper) using these data description formats ought to be out there. Some candidates are

Stronger google foo may yield more options.

Upvotes: 1

Related Questions