class TestSubobject(xmlmap.XmlObject): val = xmlmap.IntegerField('baz')
class TestObject(xmlmap.XmlObject): val = xmlmap.IntegerField('bar[2]/baz', required=True) count = xmlmap.IntegerField('count(//bar)') missing = xmlmap.IntegerField('missing') nan = xmlmap.IntegerField('@id')
class XmlObj(xmlmap.XmlObject): ROOT_NAME = 'foo' id = xmlmap.StringField('@id') strings = xmlmap.StringListField('str') int = xmlmap.IntegerField('int') bool = xmlmap.SimpleBooleanField('bool', 'yes', 'no')