1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 """
18 Provides modules containing classes to support
19 unmarshalling (XML).
20 """
21
22 from suds.sudsobject import Object
23
24
25
26 -class Content(Object):
27 """
28 @ivar node: The content source node.
29 @type node: L{sax.element.Element}
30 @ivar data: The (optional) content data.
31 @type data: L{Object}
32 @ivar text: The (optional) content (xml) text.
33 @type text: basestring
34 """
35
36 extensions = []
37
38 - def __init__(self, node, **kwargs):
39 Object.__init__(self)
40 self.node = node
41 self.data = None
42 self.text = None
43 for k,v in kwargs.items():
44 setattr(self, k, v)
45
46 - def __getattr__(self, name):
47 if name not in self.__dict__:
48 if name in self.extensions:
49 v = None
50 setattr(self, name, v)
51 else:
52 raise AttributeError, \
53 'Content has no attribute %s' % name
54 else:
55 v = self.__dict__[name]
56 return v
57