Browse Source

----------------------------------------------------------------------

Modified Files:
        XMLSchema.py -- required another condition in getItemTrace,
           need to check if at <xsd:schema> or <wsdl:definition>,
           also added some info to SchemaError throw in checkAttributes.
           Now provides namespace/attribute and the Schema Item containing
           the offending attribute.

 ----------------------------------------------------------------------
~
main
Joshua Boverhof 20 years ago
parent
commit
10322cc78e
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      XMLSchema.py

+ 4
- 2
XMLSchema.py View File

@@ -436,7 +436,7 @@ class XMLSchemaComponent(XMLBase, MarkerInterface):
"""Returns a node trace up to the <schema> 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):


Loading…
Cancel
Save