From 10322cc78e808628c4a3c3362c3ead3e003f7019 Mon Sep 17 00:00:00 2001 From: Joshua Boverhof Date: Mon, 27 Sep 2004 19:55:43 +0000 Subject: [PATCH] ---------------------------------------------------------------------- Modified Files: XMLSchema.py -- required another condition in getItemTrace, need to check if at or , also added some info to SchemaError throw in checkAttributes. Now provides namespace/attribute and the Schema Item containing the offending attribute. ---------------------------------------------------------------------- ~ --- XMLSchema.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/XMLSchema.py b/XMLSchema.py index f4a03dc..232933c 100755 --- a/XMLSchema.py +++ b/XMLSchema.py @@ -436,7 +436,7 @@ class XMLSchemaComponent(XMLBase, MarkerInterface): """Returns a node trace up to the item. """ item, path, name, ref = self, [], 'name', 'ref' - while isinstance(item, XMLSchema) is False: + while not isinstance(item,XMLSchema) and not isinstance(item,WSDLToolsAdapter): attr = item.getAttribute(name) if attr is None: attr = item.getAttribute(ref) @@ -612,7 +612,9 @@ class XMLSchemaComponent(XMLBase, MarkerInterface): if (a not in (XMLSchemaComponent.xmlns, XMLNS.XML)) and\ (a not in self.__class__.attributes.keys()) and not\ (self.isAttribute() and self.isReference()): - raise SchemaError, '%s, unknown attribute' %a + if self.attributes.has_key(a): + raise SchemaError, '%s, unknown namespaced(%s) attribute(s) %s' %(self.getItemTrace(), a,self.attributes[a]) + raise SchemaError, '%s, unknown attribute %s' %(self.getItemTrace(), a) class WSDLToolsAdapter(XMLSchemaComponent):