From 803af60cd91ddff3b1d439f2b42ffc6100d9ed96 Mon Sep 17 00:00:00 2001 From: Joshua Boverhof Date: Fri, 8 Jun 2007 21:31:45 +0000 Subject: [PATCH] M XMLSchema.py -- if can't find targetNamespace return '' as default --- XMLSchema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XMLSchema.py b/XMLSchema.py index af5500f..c748cb2 100755 --- a/XMLSchema.py +++ b/XMLSchema.py @@ -533,10 +533,10 @@ class XMLSchemaComponent(XMLBase, MarkerInterface): parent = self targetNamespace = 'targetNamespace' tns = self.attributes.get(targetNamespace) - while not tns: + while not tns and parent and parent._parent is not None: parent = parent._parent() tns = parent.attributes.get(targetNamespace) - return tns + return tns or '' def getAttributeDeclaration(self, attribute): """attribute -- attribute with a QName value (eg. type).