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,14 +189,16 @@ class WsdlDownloader
$nodes = $xpath->query($query); $nodes = $xpath->query($query);
if ($nodes->length > 0) { if ($nodes->length > 0) {
foreach ($nodes as $node) { foreach ($nodes as $node) {
$schemaLocation = $node->getAttribute('schemaLocation'); if ($node->hasAttribute('schemaLocation')) {
if ($this->isRemoteFile($schemaLocation)) { $schemaLocation = $node->getAttribute('schemaLocation');
$schemaLocation = $this->download($schemaLocation); if ($this->isRemoteFile($schemaLocation)) {
$node->setAttribute('schemaLocation', $schemaLocation); $schemaLocation = $this->download($schemaLocation);
} elseif (!is_null($parentFile)) { $node->setAttribute('schemaLocation', $schemaLocation);
$schemaLocation = $this->resolveRelativePathInUrl($parentFile, $schemaLocation); } elseif (null !== $parentFile) {
$schemaLocation = $this->download($schemaLocation); $schemaLocation = $this->resolveRelativePathInUrl($parentFile, $schemaLocation);
$node->setAttribute('schemaLocation', $schemaLocation); $schemaLocation = $this->download($schemaLocation);
$node->setAttribute('schemaLocation', $schemaLocation);
}
} }
} }
} }