Merge pull request #8 from Scheb/master

Load schemas only when there is a schemaLocation attribute
This commit is contained in:
Francis Besset 2012-08-06 02:01:01 -07:00
commit 7add8ee159

View File

@ -189,17 +189,19 @@ class WsdlDownloader
$nodes = $xpath->query($query);
if ($nodes->length > 0) {
foreach ($nodes as $node) {
if ($node->hasAttribute('schemaLocation')) {
$schemaLocation = $node->getAttribute('schemaLocation');
if ($this->isRemoteFile($schemaLocation)) {
$schemaLocation = $this->download($schemaLocation);
$node->setAttribute('schemaLocation', $schemaLocation);
} elseif (!is_null($parentFile)) {
} elseif (null !== $parentFile) {
$schemaLocation = $this->resolveRelativePathInUrl($parentFile, $schemaLocation);
$schemaLocation = $this->download($schemaLocation);
$node->setAttribute('schemaLocation', $schemaLocation);
}
}
}
}
$doc->save($cacheFile);
}