Jon Bowlas wrote at 2005-8-2 19:08 +0100: > ... >I'm pretty new to python and zope but would like to know how I can adapt >this script below to test to see if nodeValue actually contains a value and >if it doesn't then I would like to return a default value I can check for >using my zpt that references this script:
You probably should work through the Python tutorial you will find on "http://python.org". > ... >if not nodes: > > return '' > >return nodes[0].childNodes[0].nodeValue Try: nodeValue = nodes[0].childNodes[0].nodeValue if not nodeValue: return "someFault" return nodeValue -- Dieter _______________________________________________ Zope maillist - [email protected] http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
