Permalink
Browse files

Add support for XML Schema include statements.

git-svn-id: http://svn.php.net/repository/pear/packages/SOAP/trunk@265557 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 4117228 commit dcad35dfd8292ff2df2d73327487669705914fda Jan Schneider committed Aug 27, 2008
Showing with 12 additions and 8 deletions.
  1. +12 −8 WSDL.php
View
@@ -1670,27 +1670,31 @@ function startElement($parser, $name, $attrs)
// Top level elements found under wsdl:definitions.
switch ($qname->name) {
case 'import':
- // sect 2.1.1 wsdl:import attributes: namespace location
- if ((isset($attrs['location']) || isset($attrs['schemaLocation'])) &&
- !isset($this->wsdl->imports[$attrs['namespace']])) {
+ case 'include':
+ // WSDL 2.1.1 wsdl:import, XML Schema 4.2.3 xsd:import, XML Schema
+ // 4.2.1 xsd:include attributes
+ $this->status = 'types';
+ if (isset($attrs['location']) || isset($attrs['schemaLocation'])) {
$uri = isset($attrs['location']) ? $attrs['location'] : $attrs['schemaLocation'];
$location = @parse_url($uri);
if (!isset($location['scheme'])) {
$base = @parse_url($this->uri);
$uri = $this->mergeUrl($base, $uri);
}
+ if (isset($this->wsdl->imports[$uri])) {
+ break;
+ }
+ $this->wsdl->imports[$uri] = $attrs;
- $this->wsdl->imports[$attrs['namespace']] = $attrs;
$import_parser_class = get_class($this);
$import_parser =& new $import_parser_class($uri, $this->wsdl, $this->docs);
if ($import_parser->fault) {
- unset($this->wsdl->imports[$attrs['namespace']]);
+ unset($this->wsdl->imports[$uri]);
return false;
}
- $this->currentImport = $attrs['namespace'];
}
- // Continue on to the 'types' case - lack of break; is
- // intentional.
+ $this->status = 'types';
+ break;
case 'types':
// sect 2.2 wsdl:types

0 comments on commit dcad35d

Please sign in to comment.