[XML-SIG] 'Strange' behaviour of TreeWalker
Uche Ogbuji
uche.ogbuji@fourthought.com
Thu, 02 May 2002 21:57:23 -0600
> Hi,
>
> I'm quite new to Python (and pyxml / 4Suite ) and was quite confused by a
> 'strange' difference between NodeIterator and TreeWalker.
>
> While instances of NodeIterator are "printable" and give reasonable
> error messages, eg. accessing undefined attributes, instances of TreeWalker
> give hard times to novice users as __getattr__() effectively prevents any such
> access without reasonable message.
>
> Is that the intended behaviour or just an unwanted side-effect?
> At least, a note in the docs might be valuable to others.
It comes down to unfortunate implementation needs. I think TreeWalker can be
refactored to need less magic once 2.0 is the requirement for PyXML and thus
there is no need to worry about reference cycles.
--
Uche Ogbuji Fourthought, Inc.
uche.ogbuji@fourthought.com http://fourthought.com
http://4Suite.org http://uche.ogbuji.net
Track chair, XML/Web Services One (San Jose, Boston):
http://www.xmlconference.com/
RDF Query using Versa - http://www-106.ibm.com/developerworks/xml/library/x-thi
nk10/index.html
WSDL and the Wild, Wild West - http://adtmag.com/article.asp?id=6004
XML, The Model Driven Architecture, and RDF @ XML Europe -
http://www.xmleurope.com/2002/kttrack.asp#themodel