private function loadExtension(BaseComplexType $type, DOMElement $node) { $extension = new Extension(); $type->setExtension($extension); if ($node->hasAttribute("base")) { $parent = $this->findSomething('findType', $type->getSchema(), $node, $node->getAttribute("base")); $extension->setBase($parent); } foreach ($node->childNodes as $childNode) { switch ($childNode->localName) { case 'sequence': case 'choice': case 'all': $this->loadSequence($type, $childNode); break; case 'attribute': if ($childNode->hasAttribute("ref")) { $attribute = $this->findSomething('findAttribute', $type->getSchema(), $node, $childNode->getAttribute("ref")); } else { $attribute = $this->loadAttribute($type->getSchema(), $childNode); } $type->addAttribute($attribute); break; case 'attributeGroup': $attribute = $this->findSomething('findAttributeGroup', $type->getSchema(), $node, $childNode->getAttribute("ref")); $type->addAttribute($attribute); break; } } }