caustin/soaplib — pull request #3 by none-da (2012-06-27 11:43:23+00:00)
Title: Fix related to clearing `xsd_list` attribute in ModelOpener, once xsds are purged

Chris,

I believe you are aware of this fix. First, as suggested, I started trying to mimic what `ModelOpener` class is currently doing, which is :

1. Use the `XSDGenerator` to generate the xsd(s) for a single `XMLSpec`.
2. Create an `lxml.etree.XMLSchema` instance from the `XMLSpec`.
3. Run `XMLScheme.validate()` on each xml instance document.

But this started giving me a very basic error during xml vs xsd validation :

```py
Traceback (most recent call last):
File "", line 6, in
File "iterparse.pxi", line 491, in lxml.etree.iterparse.__next__ (src/lxml/lxml.etree.c:98565)
File "iterparse.pxi", line 543, in lxml.etree.iterparse._read_more_events (src/lxml/lxml.etree.c:99086)
File "parser.pxi", line 590, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:74712)
lxml.etree.XMLSyntaxError: Element '{employees}Employees': No matching global declaration available for the validation root.
```
Note: `{employees}Employees` is just a sample structure I have created.

Over the web I found there is more than one reason why this error would come. Some people mentioned there is some wrong with the xsd and some people suggested that the input xml is screwed-up. But I tried generating both through soaplib only. They cant be wrong. And I tried multiple ways to solve it and was *not* successful. So I took a lateral approach of fixing the `ModelOpener` class for the time being. Please let me know your suggestions on this.