From 21d9dc102a34381b2959a987cbf13c03a8c4f325 Mon Sep 17 00:00:00 2001 From: Joshua Boverhof Date: Mon, 1 Mar 2004 23:27:46 +0000 Subject: [PATCH] ---------------------------------------------------------------------- Modified Files: XMLSchema.py -- fixed bugs concerning Model Group References (missing minOccurs/maxOccurs), and simpleType annotations. ---------------------------------------------------------------------- --- XMLSchema.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/XMLSchema.py b/XMLSchema.py index 2fa880e..e1893b3 100755 --- a/XMLSchema.py +++ b/XMLSchema.py @@ -1375,7 +1375,7 @@ class AttributeGroupDefinition(XMLSchemaComponent,\ content = [] for indx in range(len(contents)): - component = SplitQName(i.getTagName())[1] + component = SplitQName(contents[indx].getTagName())[1] if (component == 'annotation') and (not indx): self.annotation = Annotation(self) self.annotation.fromDom(contents[indx]) @@ -1394,7 +1394,7 @@ class AttributeGroupDefinition(XMLSchemaComponent,\ content.append(AttributeWildCard()) content[-1].fromDom(contents[indx]) else: - raise SchemaError, 'Unknown component (%s)' %(i.getTagName()) + raise SchemaError, 'Unknown component (%s)' %(contents[indx].getTagName()) self.attr_content = tuple(content) @@ -1999,13 +1999,17 @@ class ModelGroupReference(XMLSchemaComponent,\ attributes: id -- ID ref -- NCName, required + minOccurs -- Whole Number, 1 + maxOccurs -- (Whole Number | 'unbounded'), 1 contents: annotation? """ required = ['ref'] attributes = {'id':None, - 'ref':None} + 'ref':None, + 'minOccurs':'1', + 'maxOccurs':'1'} contents = {'xsd':['annotation']} def __init__(self, parent): @@ -2413,6 +2417,7 @@ class SimpleType(XMLSchemaComponent,\ if component == 'annotation': self.annotation = Annotation(self) self.annotation.fromDom(child) + continue break else: return @@ -2423,7 +2428,7 @@ class SimpleType(XMLSchemaComponent,\ elif component == 'union': self.content = self.__class__.Union(self) else: - raise SchemaError, 'Unknown component (%s)' %(contents[indx].getTagName()) + raise SchemaError, 'Unknown component (%s)' %(component) self.content.fromDom(child) class Restriction(XMLSchemaComponent,\