M
marcel.vandendungen
Hi,
I'm using MSXML to select elements from a XML document and want
to slice off the last part of an IXMLDOMNodeList.
.... rgelem = rgelem[-10:]
....
Traceback (most recent call last):
File "<interactive input>", line 2, in ?
File "C:\Python24\Lib\site-packages\win32com\client\__init__.py",
line 454, in __getattr__
raise AttributeError, "'%s' object has no attribute '%s'" %
(repr(self), attr)
AttributeError: '<win32com.gen_py.Microsoft XML, v4.0.IXMLDOMNodeList
instance at 0x19500888>' object has no attribute '__len__'
The IXMLDOMNodeList obviously doesn't have a '__len__' member
function (why not?).
Is there a way to make the IXMLDOMNodeList support slicing?
I've tried to give the rgelem object a __len__ member, but got
an exception from __setattr__:
File "C:\Python24\Lib\site-packages\win32com\client\__init__.py",
line 462, in __setattr__
raise AttributeError, "'%s' object has no attribute '%s'" %
(repr(self), attr)
AttributeError: '<win32com.gen_py.Microsoft XML, v4.0.IXMLDOMNodeList
instance at 0x26395112>' object has no attribute '__len__'
Anybody know how to make this work?
TIA,
-- Marcel
I'm using MSXML to select elements from a XML document and want
to slice off the last part of an IXMLDOMNodeList.
.... rgelem = rgelem[-10:]
....
Traceback (most recent call last):
File "<interactive input>", line 2, in ?
File "C:\Python24\Lib\site-packages\win32com\client\__init__.py",
line 454, in __getattr__
raise AttributeError, "'%s' object has no attribute '%s'" %
(repr(self), attr)
AttributeError: '<win32com.gen_py.Microsoft XML, v4.0.IXMLDOMNodeList
instance at 0x19500888>' object has no attribute '__len__'
The IXMLDOMNodeList obviously doesn't have a '__len__' member
function (why not?).
Is there a way to make the IXMLDOMNodeList support slicing?
I've tried to give the rgelem object a __len__ member, but got
an exception from __setattr__:
File "C:\Python24\Lib\site-packages\win32com\client\__init__.py",
line 462, in __setattr__
raise AttributeError, "'%s' object has no attribute '%s'" %
(repr(self), attr)
AttributeError: '<win32com.gen_py.Microsoft XML, v4.0.IXMLDOMNodeList
instance at 0x26395112>' object has no attribute '__len__'
Anybody know how to make this work?
TIA,
-- Marcel