/** * @param ComponentDefinition $component * @return string */ protected function buildComponentSchema(ComponentDefinition $component) { $attributes = []; foreach ($component->getParameters() as $parameter) { $attributes[] = $this->buildComponentAttributeSchema($component, $parameter); } $body = ($component->isContainer() ? ' <xs:sequence> <xs:any minOccurs="0"/> </xs:sequence>' : '') . "\n " . implode("\n ", $attributes) . ($component->isExtraParametersAllowed() ? ' <xs:anyAttribute/>' : ''); return sprintf(' <xs:element name="%s"> <xs:complexType>%s </xs:complexType> </xs:element>', $component->getName(), $body); }