private function validateInternalSchemes(SplFileInfo $file, DOMDocument $document)
{
$schemas = [];
$attributes = $document->documentElement->attributes;
if ($schemaLocation = $attributes->getNamedItemNS(self::XSI_NAMESPACE, 'schemaLocation')) {
$parts = preg_split('/\\s{1,}/', trim($schemaLocation->textContent));
foreach ($parts as $key => $value) {
if ($key & 1) {
$schemas[] = $value;
}
}
}
if ($schemaLocNoNamespace = $attributes->getNamedItemNS(self::XSI_NAMESPACE, 'noNamespaceSchemaLocation')) {
$schemas = array_merge($schemas, preg_split('/\\s{1,}/', trim($schemaLocNoNamespace->textContent)));
}
$isValid = true;
foreach ($schemas as $scheme) {
if ($scheme = $this->locateScheme($file, $scheme)) {
$isValid = $isValid && $document->schemaValidate($scheme);
}
}
return $isValid;
}