| 781 | |
| 782 | @classmethod |
| 783 | def collate(cls, children): |
| 784 | imports = [] |
| 785 | elements = {} |
| 786 | attributes = {} |
| 787 | types = {} |
| 788 | groups = {} |
| 789 | agrps = {} |
| 790 | for c in children: |
| 791 | if isinstance(c, (Import, Include)): |
| 792 | imports.append(c) |
| 793 | continue |
| 794 | if isinstance(c, Attribute): |
| 795 | attributes[c.qname] = c |
| 796 | continue |
| 797 | if isinstance(c, Element): |
| 798 | elements[c.qname] = c |
| 799 | continue |
| 800 | if isinstance(c, Group): |
| 801 | groups[c.qname] = c |
| 802 | continue |
| 803 | if isinstance(c, AttributeGroup): |
| 804 | agrps[c.qname] = c |
| 805 | continue |
| 806 | types[c.qname] = c |
| 807 | for i in imports: |
| 808 | children.remove(i) |
| 809 | return (children, imports, attributes, elements, types, groups, agrps) |
| 810 | |
| 811 | |
| 812 | ####################################################### |