Daniel Veillard | d2897fd | 2002-01-30 16:37:32 +0000 | [diff] [blame] | 1 | import _libxml |
| 2 | |
Daniel Veillard | 36ed529 | 2002-01-30 23:49:06 +0000 | [diff] [blame^] | 3 | class xmlCore: |
Daniel Veillard | d2897fd | 2002-01-30 16:37:32 +0000 | [diff] [blame] | 4 | def __init__(self, _obj=None): |
| 5 | if _obj != None: |
| 6 | self._o = _obj; |
| 7 | return |
| 8 | self._o = None |
| 9 | |
Daniel Veillard | d2897fd | 2002-01-30 16:37:32 +0000 | [diff] [blame] | 10 | def __getattr__(self, attr): |
| 11 | if attr == "parent": |
| 12 | ret = _libxml.parent(self._o) |
| 13 | if ret == None: |
| 14 | return None |
| 15 | return xmlNode(_obj=ret) |
| 16 | elif attr == "properties": |
| 17 | ret = _libxml.properties(self._o) |
| 18 | if ret == None: |
| 19 | return None |
| 20 | return xmlNode(_obj=ret) |
| 21 | elif attr == "children": |
| 22 | ret = _libxml.children(self._o) |
| 23 | if ret == None: |
| 24 | return None |
| 25 | return xmlNode(_obj=ret) |
| 26 | elif attr == "last": |
| 27 | ret = _libxml.last(self._o) |
| 28 | if ret == None: |
| 29 | return None |
| 30 | return xmlNode(_obj=ret) |
| 31 | elif attr == "next": |
| 32 | ret = _libxml.next(self._o) |
| 33 | if ret == None: |
| 34 | return None |
| 35 | return xmlNode(_obj=ret) |
| 36 | elif attr == "prev": |
| 37 | ret = _libxml.prev(self._o) |
| 38 | if ret == None: |
| 39 | return None |
| 40 | return xmlNode(_obj=ret) |
| 41 | elif attr == "content": |
| 42 | return self.content() |
| 43 | elif attr == "name": |
| 44 | return _libxml.name(self._o) |
| 45 | elif attr == "type": |
| 46 | return _libxml.type(self._o) |
| 47 | elif attr == "doc": |
| 48 | ret = _libxml.doc(self._o) |
| 49 | if ret == None: |
| 50 | return None |
| 51 | return xmlDoc(_doc=ret) |
| 52 | raise AttributeError,attr |
| 53 | |
| 54 | # |
| 55 | # Those are common attributes to nearly all type of nodes |
| 56 | # |
| 57 | def get_parent(self): |
| 58 | ret = _libxml.parent(self._o) |
| 59 | if ret == None: |
| 60 | return None |
| 61 | return xmlNode(_obj=ret) |
| 62 | def get_children(self): |
| 63 | ret = _libxml.children(self._o) |
| 64 | if ret == None: |
| 65 | return None |
| 66 | return xmlNode(_obj=ret) |
| 67 | def get_last(self): |
| 68 | ret = _libxml.last(self._o) |
| 69 | if ret == None: |
| 70 | return None |
| 71 | return xmlNode(_obj=ret) |
| 72 | def get_next(self): |
| 73 | ret = _libxml.next(self._o) |
| 74 | if ret == None: |
| 75 | return None |
| 76 | return xmlNode(_obj=ret) |
| 77 | def get_prev(self): |
| 78 | ret = _libxml.prev(self._o) |
| 79 | if ret == None: |
| 80 | return None |
| 81 | return xmlNode(_obj=ret) |
| 82 | def get_content(self): |
| 83 | return self.content() |
| 84 | def get_name(self): |
| 85 | return _libxml.name(self._o) |
| 86 | def get_type(self): |
| 87 | return _libxml.type(self._o) |
| 88 | def get_doc(self): |
| 89 | ret = _libxml.doc(self._o) |
| 90 | if ret == None: |
| 91 | return None |
| 92 | return xmlDoc(_doc=ret) |
| 93 | def free(self): |
| 94 | _libxml.freeDoc(self._o) |
| 95 | |
Daniel Veillard | 36ed529 | 2002-01-30 23:49:06 +0000 | [diff] [blame^] | 96 | # |
| 97 | # Everything below this point is automatically generated |
| 98 | # |