public function generateXsdCommand($phpNamespace, $xsdNamespace = null, $targetFile = null)
{
if ($xsdNamespace === null) {
$xsdNamespace = sprintf('http://typo3.org/ns/%s', str_replace('\\', '/', $phpNamespace));
}
$xsdSchema = '';
try {
$xsdSchema = $this->xsdGenerator->generateXsd($phpNamespace, $xsdNamespace);
} catch (Service\Exception $exception) {
$this->outputLine('An error occurred while trying to generate the XSD schema:');
$this->outputLine('%s', array($exception->getMessage()));
$this->quit(1);
}
if ($targetFile === null) {
$this->output($xsdSchema);
} else {
file_put_contents($targetFile, $xsdSchema);
}
}