├── .php-cs-fixer.dist.php ├── LICENSE ├── README.md ├── bin └── wsdl ├── composer.json ├── psalm.xml ├── src ├── Console │ ├── AppFactory.php │ ├── Command │ │ ├── FlattenCommand.php │ │ └── ValidateCommand.php │ ├── Configurator.php │ └── Helper │ │ └── ConfiguredLoader.php ├── Exception │ └── UnloadableWsdlException.php ├── Loader │ ├── CallbackLoader.php │ ├── Context │ │ └── FlatteningContext.php │ ├── FlatteningLoader.php │ ├── StreamWrapperLoader.php │ └── WsdlLoader.php ├── Uri │ └── IncludePathBuilder.php └── Xml │ ├── Configurator │ ├── FlattenTypes.php │ ├── FlattenWsdlImports.php │ └── FlattenXsdImports.php │ ├── Exception │ └── FlattenException.php │ ├── Flattener.php │ ├── Validator │ ├── SchemaSyntaxValidator.php │ └── WsdlSyntaxValidator.php │ ├── Visitor │ └── ReprefixTypeQname.php │ └── Xmlns │ ├── FixRemovedDefaultXmlnsDeclarationsDuringImport.php │ └── RegisterNonConflictingXmlnsNamespaces.php ├── stubs └── dom.phpstub └── xsd ├── XMLSchema.xsd ├── oasis-200401-wss-wssecurity-secext-1.0.xsd ├── oasis-200401-wss-wssecurity-utility-1.0.xsd ├── soap11-envelope.xsd ├── wsdl.xsd ├── xml.xsd └── xmldsig-core-schema.xsd /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | setFinder( 5 | \Symfony\Component\Finder\Finder::create() 6 | ->in([ 7 | __DIR__ . '/src', 8 | __DIR__ . '/tests', 9 | ]) 10 | ->name('*.php') 11 | ) 12 | ->setRiskyAllowed(true) 13 | ->setRules([ 14 | '@PSR2' => true, 15 | 'align_multiline_comment' => true, 16 | 'array_indentation' => true, 17 | 'declare_strict_types' => true, 18 | 'final_class' => true, 19 | 'global_namespace_import' => [ 20 | 'import_classes' => true, 21 | 'import_constants' => true, 22 | 'import_functions' => true, 23 | ], 24 | 'list_syntax' => [ 25 | 'syntax' => 'short', 26 | ], 27 | 'constant_case' => [ 28 | 'case' => 'lower', 29 | ], 30 | 'multiline_comment_opening_closing' => true, 31 | 'native_function_casing' => true, 32 | 'no_empty_phpdoc' => true, 33 | 'no_leading_import_slash' => true, 34 | 'no_superfluous_phpdoc_tags' => [ 35 | 'allow_mixed' => true, 36 | ], 37 | 'no_unused_imports' => true, 38 | 'no_useless_else' => true, 39 | 'no_useless_return' => true, 40 | 'ordered_imports' => [ 41 | 'imports_order' => ['class', 'function', 'const'], 42 | ], 43 | 'ordered_interfaces' => true, 44 | 'php_unit_test_annotation' => true, 45 | 'php_unit_test_case_static_method_calls' => [ 46 | 'call_type' => 'static', 47 | ], 48 | 'php_unit_method_casing' => [ 49 | 'case' => 'snake_case', 50 | ], 51 | 'single_import_per_statement' => true, 52 | 'single_trait_insert_per_statement' => true, 53 | 'static_lambda' => true, 54 | 'strict_comparison' => true, 55 | 'strict_param' => true, 56 | 'nullable_type_declaration_for_default_null_value' => true, 57 | ]) 58 | ; 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2021-MAX_INT php-soap 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WSDL 2 | 3 | This package provides tools and helpers for dealing with WSDLs. 4 | 5 | # Want to help out? 💚 6 | 7 | - [Become a Sponsor](https://github.com/php-soap/.github/blob/main/HELPING_OUT.md#sponsor) 8 | - [Let us do your implementation](https://github.com/php-soap/.github/blob/main/HELPING_OUT.md#let-us-do-your-implementation) 9 | - [Contribute](https://github.com/php-soap/.github/blob/main/HELPING_OUT.md#contribute) 10 | - [Help maintain these packages](https://github.com/php-soap/.github/blob/main/HELPING_OUT.md#maintain) 11 | 12 | Want more information about the future of this project? Check out this list of the [next big projects](https://github.com/php-soap/.github/blob/main/PROJECTS.md) we'll be working on. 13 | 14 | # Installation 15 | 16 | ```bash 17 | composer require php-soap/wsdl 18 | ``` 19 | 20 | ## WSDL Loader 21 | 22 | A WSDL loader is able to load the contents of a WSDL file. 23 | 24 | ### Psr18Loader 25 | 26 | For loading WSDL's, you might want to use a PSR-18 client to do the hard HTTP work. 27 | You'll have to include the [php-soap/psr18-transport](https://github.com/php-soap/psr18-transport/#psr18loader) in order to use this loader: 28 | 29 | ```sh 30 | composer require php-soap/psr18-transport 31 | ``` 32 | 33 | ```php 34 | use Http\Client\Common\PluginClient; 35 | use Soap\Psr18Transport\Wsdl\Psr18Loader; 36 | 37 | $loader = Psr18Loader::createForClient( 38 | $wsdlClient = new PluginClient( 39 | $psr18Client, 40 | ...$middleware 41 | ) 42 | ); 43 | 44 | $contents = $loader('http://some.wsdl'); 45 | ``` 46 | 47 | 48 | ### StreamWrapperLoader 49 | 50 | Loads the content of a WSDL by using any of the enabled [stream wrappers](https://www.php.net/manual/en/wrappers.php). 51 | It can either be a file, http, ... 52 | 53 | ```php 54 | use Soap\Wsdl\Loader\StreamWrapperLoader; 55 | 56 | $loader = new StreamWrapperLoader( 57 | stream_context_create([ 58 | 'http' => [ 59 | 'method' => 'GET', 60 | 'header'=>"User-Agent: my loader\r\n", 61 | ], 62 | ]) 63 | ); 64 | $contents = $loader($wsdl); 65 | ``` 66 | 67 | ### FlatteningLoader 68 | 69 | This loader can be used if your WSDL file contains WSDL or XSD imports. 70 | It will any other loader internally to load all the parts. 71 | The result of this loader is a completely flattened WSDL file which you can e.g. cache on your local filesystem. 72 | 73 | ```php 74 | use Soap\Wsdl\Loader\FlatteningLoader; 75 | use Soap\Wsdl\Loader\StreamWrapperLoader; 76 | 77 | $loader = new FlatteningLoader(new StreamWrapperLoader()); 78 | 79 | $contents = $loader($wsdl); 80 | ``` 81 | 82 | ### CallbackLoader 83 | 84 | This loader can be used if you want to have more control about how to load a WSDL. 85 | It can be used to decorate another loader, add debug statements, apply custom loading logic, ... 86 | 87 | ```php 88 | use Soap\Wsdl\Loader\CallbackLoader; 89 | 90 | $loader = new CallbackLoader(static function (string $location) use ($loader, $style): string { 91 | $style->write('> Loading '.$location . '...'); 92 | 93 | $result = $loader($location); 94 | $style->writeln(' DONE!'); 95 | 96 | return $result; 97 | }) 98 | 99 | $contents = $loader($wsdl); 100 | ``` 101 | 102 | ## WSDL CLI Tools 103 | 104 | ``` 105 | wsdl-tools 1.0.0 106 | 107 | Available commands: 108 | completion Dump the shell completion script 109 | flatten Flatten a remote or local WSDL file into 1 file that contains all includes. 110 | help Display help for a command 111 | list List commands 112 | validate Run validations a (flattened) WSDL file. 113 | ``` 114 | 115 | ### Flattening 116 | 117 | ``` 118 | ./bin/wsdl flatten 'https://your/?wsdl' out.wsdl 119 | ``` 120 | 121 | This command will download the provided WSDL location. 122 | If any imports are detected, it will download these as well. 123 | The final result is stored in a single WSDL file. 124 | 125 | ### Validating 126 | 127 | ``` 128 | ./bin/wsdl validate out.wsdl 129 | ``` 130 | 131 | This command performs some basic validations on the provided WSDL file. 132 | If your WSDL contains any imports, you'll have to flatten the WSDL into a single file first. 133 | 134 | ### Extensions 135 | 136 | By installing additional packages from `php-soap`, additional commands will be added to the WSDL tools: 137 | 138 | * [wsdl-reader](https://github.com/php-soap/wsdl-reader): Will install inspect commands that will give you a human-readable version of all information inside your WSDL. 139 | 140 | ### Custom WSDL Loader 141 | 142 | By default, all CLI tools use the StreamWrapperLoader. 143 | All CLI tools have a `--loader=file.php` option that can be used to apply a custom WSDL loader. 144 | This can be handy if your WSDL is located behind authentication or if you want to get control over the HTTP level. 145 | 146 | Example custom PHP loader: 147 | 148 | ```php 149 | [ 156 | 'method' => 'GET', 157 | 'header'=> sprintf('Authorization: Basic %s', base64_encode('username:password')), 158 | ], 159 | ]) 160 | ); 161 | ``` 162 | 163 | ## WSDL Validators 164 | 165 | This package contains some tools you can use to validate the format of WSDL files. 166 | It uses the power of [veewee/xml DOM Validators](https://github.com/veewee/xml/blob/master/docs/dom.md#validators) internally. 167 | 168 | ### SchemaSyntaxValidator 169 | 170 | Validates all defined schemas and returns a list of all issues. 171 | 172 | ```php 173 | use Soap\Wsdl\Loader\StreamWrapperLoader; 174 | use Soap\Wsdl\Xml\Validator; 175 | use VeeWee\Xml\Dom\Document; 176 | 177 | $wsdl = Document::fromXmlString((new StreamWrapperLoader())($file)); 178 | 179 | echo "Validating Schemas".PHP_EOL; 180 | $issues = $wsdl->validate(new Validator\SchemaSyntaxValidator()); 181 | echo ($issues->count() ? $issues->toString() : '🟢 ALL GOOD').PHP_EOL; 182 | ``` 183 | 184 | ### WsdlSyntaxValidator 185 | 186 | Validates the WSDL file and returns a list of all issues. 187 | 188 | ```php 189 | use Soap\Wsdl\Loader\StreamWrapperLoader; 190 | use Soap\Wsdl\Xml\Validator; 191 | use VeeWee\Xml\Dom\Document; 192 | 193 | $wsdl = Document::fromXmlString((new StreamWrapperLoader())($file)); 194 | 195 | echo "Validating WSDL:".PHP_EOL; 196 | $issues = $wsdl->validate(new Validator\WsdlSyntaxValidator()); 197 | echo ($issues->count() ? $issues->toString() : '🟢 ALL GOOD').PHP_EOL; 198 | -------------------------------------------------------------------------------- /bin/wsdl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 37 | })(); 38 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "php-soap/wsdl", 3 | "description": "Deals with WSDLs", 4 | "type": "library", 5 | "license": "MIT", 6 | "autoload": { 7 | "psr-4": { 8 | "Soap\\Wsdl\\": "src/" 9 | } 10 | }, 11 | "autoload-dev": { 12 | "psr-4": { 13 | "SoapTest\\Wsdl\\": "tests/" 14 | } 15 | }, 16 | "authors": [ 17 | { 18 | "name": "Toon Verwerft", 19 | "email": "toonverwerft@gmail.com" 20 | } 21 | ], 22 | "bin": [ 23 | "bin/wsdl" 24 | ], 25 | "config": { 26 | "sort-packages": true 27 | }, 28 | "require": { 29 | "php": "~8.2.0 || ~8.3.0 || ~8.4.0", 30 | "ext-dom": "*", 31 | "azjezz/psl": "^3.0", 32 | "league/uri": "^7.0", 33 | "league/uri-components": "^7.0", 34 | "php-soap/xml": "^1.8", 35 | "symfony/console": "^5.4 || ^6.0 || ^7.0", 36 | "veewee/xml": "~3.0" 37 | }, 38 | "require-dev": { 39 | "phpunit/phpunit": "^10.5", 40 | "psalm/plugin-symfony": "^5.0", 41 | "vimeo/psalm": "^5.26.0" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /psalm.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/Console/AppFactory.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | private static array $configurators = [ 16 | \Soap\WsdlReader\Console\WsdlReaderConfigurator::class 17 | ]; 18 | 19 | /** 20 | * @throws LogicException 21 | */ 22 | public static function create(): Application 23 | { 24 | $app = new Application('wsdl-tools', '1.0.0'); 25 | $app->addCommands([ 26 | new Command\FlattenCommand(), 27 | new Command\ValidateCommand(), 28 | ]); 29 | 30 | self::configure($app); 31 | 32 | return $app; 33 | } 34 | 35 | private static function configure(Application $app): void 36 | { 37 | foreach (self::$configurators as $configurator) { 38 | if (!class_exists($configurator) || !is_a($configurator, Configurator::class, true)) { 39 | continue; 40 | } 41 | 42 | $configurator::configure($app); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Console/Command/FlattenCommand.php: -------------------------------------------------------------------------------- 1 | setDescription('Flatten a remote or local WSDL file into 1 file that contains all includes.'); 35 | $this->addArgument('wsdl', InputArgument::REQUIRED, 'Provide the URI of the WSDL you want to flatten'); 36 | $this->addArgument('output', InputArgument::REQUIRED, 'Define where the file must be written to'); 37 | $this->addOption('loader', 'l', InputOption::VALUE_REQUIRED, 'Customize the WSDL loader file that will be used'); 38 | } 39 | 40 | /** 41 | * @throws Exception 42 | */ 43 | protected function execute(InputInterface $input, OutputInterface $output): int 44 | { 45 | $style = new SymfonyStyle($input, $output); 46 | $loader = ConfiguredLoader::createFromConfig( 47 | $input->getOption('loader'), 48 | fn (WsdlLoader $loader) => $this->configureLoader($loader, $style) 49 | ); 50 | $wsdl = non_empty_string()->coerce($input->getArgument('wsdl')); 51 | $output = non_empty_string()->coerce($input->getArgument('output')); 52 | 53 | $style->info('Flattening WSDL "'.$wsdl.'"'); 54 | $style->warning('This can take a while...'); 55 | $contents = $loader($wsdl); 56 | 57 | $style->info('Downloaded the WSDL. Writing it to "'.$output.'".'); 58 | 59 | File\write($output, $contents, WriteMode::Truncate); 60 | 61 | $style->success('Succesfully flattened your WSDL!'); 62 | 63 | return self::SUCCESS; 64 | } 65 | 66 | private function configureLoader(WsdlLoader $loader, SymfonyStyle $style): WsdlLoader 67 | { 68 | return new FlatteningLoader( 69 | new CallbackLoader(static function (string $location) use ($loader, $style): string { 70 | $style->write('> Loading '.$location . '...'); 71 | 72 | $result = $loader($location); 73 | $style->writeln(' DONE!'); 74 | 75 | return $result; 76 | }) 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/Console/Command/ValidateCommand.php: -------------------------------------------------------------------------------- 1 | setDescription('Run validations a (flattened) WSDL file.'); 34 | $this->addArgument('wsdl', InputArgument::REQUIRED, 'Provide the URI of the WSDL you want to validate'); 35 | $this->addOption('loader', 'l', InputOption::VALUE_REQUIRED, 'Customize the WSDL loader file that will be used'); 36 | } 37 | 38 | /** 39 | * @throws Exception 40 | */ 41 | protected function execute(InputInterface $input, OutputInterface $output): int 42 | { 43 | $style = new SymfonyStyle($input, $output); 44 | $loader = ConfiguredLoader::createFromConfig($input->getOption('loader')); 45 | $wsdl = $input->getArgument('wsdl'); 46 | 47 | $style->info('Loading "'.$wsdl.'"...'); 48 | $document = Document::fromXmlString( 49 | non_empty_string()->assert($loader($wsdl)) 50 | ); 51 | $xpath = $document->xpath(new WsdlPreset($document)); 52 | 53 | $result = $this->runValidationStage( 54 | $style, 55 | 'Validating WSDL syntax', 56 | static fn () => $document->validate(new Validator\WsdlSyntaxValidator()) 57 | ); 58 | 59 | $result = $result && $this->runValidationStage( 60 | $style, 61 | 'Validating XSD types...', 62 | static function () use ($style, $document, $xpath): ?IssueCollection { 63 | $schemas = $xpath->query('//schema:schema'); 64 | if ($schemas->count() !== 1) { 65 | $style->warning('Skipped : XSD types can only be validated if there is one schema element.'); 66 | return null; 67 | } 68 | 69 | return $document->validate(new Validator\SchemaSyntaxValidator()); 70 | } 71 | ); 72 | 73 | return $result ? self::SUCCESS : self::FAILURE; 74 | } 75 | 76 | /** 77 | * @param callable(): ?IssueCollection $validator 78 | */ 79 | private function runValidationStage(SymfonyStyle $style, string $label, callable $validator): bool 80 | { 81 | $style->info($label.'...'); 82 | $issues = $validator(); 83 | 84 | // Skipped ... 85 | if ($issues === null) { 86 | return true; 87 | } 88 | 89 | if ($issues->count()) { 90 | $style->block($issues->toString()); 91 | $style->error('Validation failed!'); 92 | return false; 93 | } 94 | 95 | $style->success('All good!'); 96 | return true; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/Console/Configurator.php: -------------------------------------------------------------------------------- 1 | assert($included); 36 | } 37 | 38 | return $configurator !== null ? $configurator($loader) : $loader; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Exception/UnloadableWsdlException.php: -------------------------------------------------------------------------------- 1 | getMessage(), (int)$e->getCode(), $e); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Loader/CallbackLoader.php: -------------------------------------------------------------------------------- 1 | callback = $callback; 22 | } 23 | 24 | /** 25 | * @throws UnloadableWsdlException 26 | */ 27 | public function __invoke(string $location): string 28 | { 29 | try { 30 | return ($this->callback)($location); 31 | } catch (UnloadableWsdlException $e) { 32 | throw $e; 33 | } catch (Exception $e) { 34 | throw UnloadableWsdlException::fromException($e); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Loader/Context/FlatteningContext.php: -------------------------------------------------------------------------------- 1 | raw (not flattened) xml 22 | * 23 | * @var array 24 | */ 25 | private $catalog = []; 26 | 27 | public static function forWsdl( 28 | string $location, 29 | Document $wsdl, 30 | WsdlLoader $loader, 31 | ): self { 32 | $new = new self($wsdl, $loader); 33 | $new->catalog[$location] = $wsdl->map(xml_string()); 34 | 35 | return $new; 36 | } 37 | 38 | private function __construct( 39 | private Document $wsdl, 40 | private WsdlLoader $loader 41 | ) { 42 | } 43 | 44 | /** 45 | * This function can be used to detect if the context knows about a part of the WSDL. 46 | * It knows about a part from the moment that the raw XML version has been loaded once, 47 | * even if the flattening process is still in an underlying import / include. 48 | */ 49 | public function knowsAboutPart(string $location): bool 50 | { 51 | return array_key_exists($location, $this->catalog); 52 | } 53 | 54 | /** 55 | * Imports and include only need to occur once. 56 | * This function determines if an import should be done. 57 | * 58 | * It either returns null if the import already was done or the flattened XML if it still requires an import. 59 | */ 60 | public function import(string $location): ?string 61 | { 62 | return $this->knowsAboutPart($location) 63 | ? null 64 | : $this->loadFlattenedXml($location); 65 | } 66 | 67 | /** 68 | * Returns the base WSDL document that can be worked on by flattener configurators. 69 | */ 70 | public function wsdl(): Document 71 | { 72 | return $this->wsdl; 73 | } 74 | 75 | /** 76 | * This method searches for a single tag 77 | * If no tag exists, it will create an empty one. 78 | * If multiple tags exist, it will merge those tags into one. 79 | * 80 | * @throws RuntimeException 81 | */ 82 | public function types(): DOMElement 83 | { 84 | $doc = Document::fromUnsafeDocument($this->wsdl->toUnsafeDocument(), new FlattenTypes()); 85 | $xpath = $doc->xpath(new WsdlPreset($doc)); 86 | 87 | /** @var DOMElement $types */ 88 | $types = $xpath->querySingle('//wsdl:types'); 89 | 90 | return $types; 91 | } 92 | 93 | /** 94 | * This function will take care of the import catalog! 95 | * It will first load the raw xml from the remote source and store that internally. 96 | * 97 | * Next it will apply the XML flattening on the loaded xml and return the flattened string. 98 | * We keep track of all nested flattening locations that are in progress. 99 | * This way we can prevent circular includes as well. 100 | * 101 | * @throws UnloadableWsdlException 102 | * @throws RuntimeException 103 | * @throws AssertException 104 | */ 105 | private function loadFlattenedXml(string $location): string 106 | { 107 | if (!array_key_exists($location, $this->catalog)) { 108 | $this->catalog[$location] = ($this->loader)($location); 109 | } 110 | 111 | $document = Document::fromXmlString( 112 | non_empty_string()->assert($this->catalog[$location]) 113 | ); 114 | 115 | return (new Flattener())($location, $document, $this); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/Loader/FlatteningLoader.php: -------------------------------------------------------------------------------- 1 | assert(($this->loader)($location)) 30 | ); 31 | $context = FlatteningContext::forWsdl($location, $currentDoc, $this->loader); 32 | 33 | return (new Flattener())($location, $currentDoc, $context); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Loader/StreamWrapperLoader.php: -------------------------------------------------------------------------------- 1 | context = $context; 24 | } 25 | 26 | public function __invoke(string $location): string 27 | { 28 | try { 29 | $content = @file_get_contents( 30 | $location, 31 | context: is_resource($this->context) ? $this->context : null 32 | ); 33 | } catch (Exception $e) { 34 | throw UnloadableWsdlException::fromException($e); 35 | } 36 | 37 | if ($content === false) { 38 | throw UnloadableWsdlException::fromLocation($location); 39 | } 40 | 41 | return $content; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Loader/WsdlLoader.php: -------------------------------------------------------------------------------- 1 | resolve($relativePath)) 15 | ->removeDotSegments() 16 | ->removeEmptySegments() 17 | ->getUri() 18 | ->__toString() 19 | ; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Xml/Configurator/FlattenTypes.php: -------------------------------------------------------------------------------- 1 | xpath(new WsdlPreset($xml)); 31 | /** @var list $types */ 32 | $types = [...$xpath->query('wsdl:types')]; 33 | 34 | // Creates wsdl:types if no matching element exists yet 35 | if (!count($types)) { 36 | $document->documentElement->append( 37 | namespaced_element(Xmlns::wsdl()->value(), 'types')($document) 38 | ); 39 | 40 | return $document; 41 | } 42 | 43 | // Skip if only one exists 44 | $first = array_shift($types); 45 | if (!count($types)) { 46 | return $document; 47 | } 48 | 49 | // Flattens multiple wsdl:types elements. 50 | foreach ($types as $additionalTypes) { 51 | $children = children($additionalTypes); 52 | if (count($children)) { 53 | append(...$children)($first); 54 | } 55 | 56 | remove($additionalTypes); 57 | } 58 | 59 | return $document; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/Xml/Configurator/FlattenWsdlImports.php: -------------------------------------------------------------------------------- 1 | xpath(new WsdlPreset($xml)); 47 | 48 | $imports = $xpath->query('wsdl:import')->expectAllOfType(DOMElement::class); 49 | $imports->forEach(fn (DOMElement $import) => $this->importWsdlImportElement($import)); 50 | 51 | return $document; 52 | } 53 | 54 | /** 55 | * @throws RuntimeException 56 | * @throws UnloadableWsdlException 57 | */ 58 | private function importWsdlImportElement(DOMElement $import): void 59 | { 60 | $location = IncludePathBuilder::build( 61 | $import->getAttribute('location'), 62 | $this->currentLocation 63 | ); 64 | 65 | $result = $this->context->import($location); 66 | if ($result === null || $result === '') { 67 | remove($import); 68 | return; 69 | } 70 | 71 | $imported = Document::fromXmlString($result); 72 | 73 | // A wsdl:import can be either a WSDL or an XSD file: 74 | match ($imported->locateDocumentElement()->namespaceURI) { 75 | Xmlns::xsd()->value() => $this->importXsdPart($import, $imported), 76 | default => $this->importWsdlPart($import, $imported), 77 | }; 78 | } 79 | 80 | /** 81 | * @throws RuntimeException 82 | */ 83 | private function importWsdlPart(DOMElement $importElement, Document $importedDocument): void 84 | { 85 | $definitions = $importedDocument->map(document_element()); 86 | copy_named_xmlns_attributes($importElement->ownerDocument->documentElement, $definitions); 87 | 88 | replace_by_external_nodes( 89 | $importElement, 90 | children($definitions) 91 | ); 92 | } 93 | 94 | /** 95 | * @throws RuntimeException 96 | */ 97 | private function importXsdPart(DOMElement $importElement, Document $importedDocument): void 98 | { 99 | $types = $this->context->types(); 100 | remove($importElement); 101 | append_external_node($types, $importedDocument->locateDocumentElement()); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/Xml/Configurator/FlattenXsdImports.php: -------------------------------------------------------------------------------- 1 | xpath(new WsdlPreset($xml)); 50 | 51 | $imports = $xpath 52 | ->query('//schema:import|//schema:include|//schema:redefine') 53 | ->expectAllOfType(DOMElement::class); 54 | 55 | if (!count($imports)) { 56 | return $document; 57 | } 58 | 59 | foreach ($imports as $import) { 60 | $schema = match ($import->localName) { 61 | 'include', 'redefine' => $this->includeSchema($import), 62 | 'import' => $this->importSchema($import), 63 | }; 64 | 65 | if ($schema) { 66 | $this->registerSchemaInTypes($schema); 67 | } 68 | } 69 | 70 | $this->rearrangeImportsAsFirstElements($xml); 71 | 72 | return $document; 73 | } 74 | 75 | /** 76 | * @throws RuntimeException 77 | * @throws UnloadableWsdlException 78 | * @throws FlattenException 79 | */ 80 | private function includeSchema(DOMElement $include): ?DOMElement 81 | { 82 | // All includes and redefines require a schemLocation attribute 83 | if (!$location = $include->getAttribute('schemaLocation')) { 84 | throw FlattenException::noLocation($include->localName); 85 | } 86 | 87 | /* 88 | * Target namespace rules: 89 | * 90 | * @see https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms256198(v=vs.100) 91 | * The included schema document must meet one of the following conditions. 92 | - It must have the same target namespace as the containing schema document. 93 | - It must not have a target namespace specified (no targetNamespace attribute). 94 | In that case, the including schema document provides the target namespace for the new one. 95 | */ 96 | 97 | // Detect namespaces from both the current schema and the import 98 | $parentSchema = $this->detectParentSchemaNode($include); 99 | $parentTns = $parentSchema->getAttribute('targetNamespace'); 100 | 101 | $schema = $this->loadSchema($location); 102 | if ($schema) { 103 | // If the included schema has no targetNamespace, it will inherit the parent schema's namespace. 104 | if (!$schema->hasAttribute('targetNamespace')) { 105 | $schema->setAttribute('targetNamespace', $parentTns); 106 | } 107 | 108 | // Validate if the namespaces of the included document match the parent schema. 109 | $schemaTns = $schema->getAttribute('targetNamespace'); 110 | if ($schemaTns !== $parentTns) { 111 | throw FlattenException::invalidIncludeTargetNamespace($parentTns, $schemaTns); 112 | } 113 | 114 | // Redefines overwrite tags from includes. 115 | // The children of redefine elements are appended to the newly loaded schema. 116 | if ($include->localName === 'redefine') { 117 | children($include)->map( 118 | static fn (DOMNode $node) => append_external_node($schema, $node) 119 | ); 120 | } 121 | } 122 | 123 | // Include tags can be removed, since the schema will be made available in the types 124 | // using the namespace it defines. The include/redefine tag will have no purpose anymore. 125 | remove($include); 126 | 127 | return $schema; 128 | } 129 | 130 | /** 131 | * @throws RuntimeException 132 | * @throws UnloadableWsdlException 133 | * @throws FlattenException 134 | */ 135 | private function importSchema(DOMElement $import): ?DOMElement 136 | { 137 | // xsd:import tags don't require a location! 138 | $location = $import->getAttribute('schemaLocation'); 139 | if (!$location) { 140 | return null; 141 | } 142 | 143 | // Detect namespaces from both the current schema and the import 144 | $namespace = $import->getAttribute('namespace'); 145 | $parentSchema = $this->detectParentSchemaNode($import); 146 | $parentTns = $parentSchema->getAttribute('targetNamespace'); 147 | 148 | // Imports can only deal with different namespaces. 149 | // You'll need to use "include" if you want to inject something in the same namespace. 150 | if ($parentTns && $namespace && $parentTns === $namespace) { 151 | throw FlattenException::unableToImportXsd($location); 152 | } 153 | 154 | // After loading the schema, the import element needs to remain in the XSD. 155 | // The schema location is removed, since it will be embedded in the WSDL. 156 | $schema = $this->loadSchema($location); 157 | $import->removeAttribute('schemaLocation'); 158 | 159 | return $schema; 160 | } 161 | 162 | /** 163 | * This function will return the parent declaring tag for elements like import | include, ... 164 | * 165 | * @throws RuntimeException 166 | */ 167 | private function detectParentSchemaNode(DOMElement $element): DOMElement 168 | { 169 | $parent = Document::fromUnsafeDocument($element->ownerDocument); 170 | $xpath = $parent->xpath(new WsdlPreset($parent)); 171 | 172 | /** @var DOMElement */ 173 | return $xpath->querySingle('ancestor::schema:schema', $element); 174 | } 175 | 176 | /** 177 | * @throws RuntimeException 178 | * @throws UnloadableWsdlException 179 | */ 180 | private function loadSchema(string $location): ?DOMElement 181 | { 182 | $path = IncludePathBuilder::build($location, $this->currentLocation); 183 | $result = $this->context->import($path); 184 | 185 | if ($result === null || $result === '') { 186 | return null; 187 | } 188 | 189 | $imported = Document::fromXmlString($result); 190 | /** @var DOMElement $schema */ 191 | $schema = $imported->xpath(new WsdlPreset($imported))->querySingle('/schema:schema'); 192 | 193 | return $schema; 194 | } 195 | 196 | /** 197 | * This function registers the newly provided schema in the WSDL types section. 198 | * It groups all imports by targetNamespace. 199 | * 200 | * @throws \RuntimeException 201 | * @throws RuntimeException 202 | * @throws AssertException 203 | */ 204 | private function registerSchemaInTypes(DOMElement $schema): void 205 | { 206 | $wsdl = $this->context->wsdl(); 207 | $xpath = $wsdl->xpath(new WsdlPreset($wsdl)); 208 | $types = $this->context->types(); 209 | $tns = $schema->getAttribute('targetNamespace'); 210 | 211 | $query = $tns ? './schema:schema[@targetNamespace=\''.$tns.'\']' : './schema:schema[not(@targetNamespace)]'; 212 | $existingSchema = nullable(instance_of(DOMElement::class)) 213 | ->assert($xpath->query($query, $types)->first()); 214 | 215 | // If no schema exists yet: Add the newly loaded schema as a completely new schema in the WSDL types. 216 | if (!$existingSchema) { 217 | $imported = assert_element(append_external_node($types, $schema)); 218 | (new FixRemovedDefaultXmlnsDeclarationsDuringImport())($imported, $schema); 219 | return; 220 | } 221 | 222 | // When an existing schema exists, all xmlns attributes need to be copied. 223 | // This is to make sure that possible QNames (strings) get resolved in XSD. 224 | // Finally - all children of the newly loaded schema can be appended to the existing schema. 225 | (new RegisterNonConflictingXmlnsNamespaces())($existingSchema, $schema); 226 | children($schema)->forEach( 227 | static fn (DOMNode $node) => append_external_node($existingSchema, $node) 228 | ); 229 | } 230 | 231 | /** 232 | * Makes sure to rearrange the import statements on top of the flattened XSD schema. 233 | * This makes the flattened XSD spec compliant: 234 | * 235 | * @see https://www.w3.org/TR/xmlschema11-1/#declare-schema 236 | * 237 | * 238 | * Content: ((include | import | redefine | override | annotation)*, 239 | * (defaultOpenContent, annotation*)?, 240 | * ((simpleType | complexType | group | attributeGroup | element | attribute | notation), annotation*)*) 241 | * 242 | * 243 | * @throws RuntimeException 244 | */ 245 | private function rearrangeImportsAsFirstElements(Document $xml): void 246 | { 247 | $xpath = $xml->xpath(new WsdlPreset($xml)); 248 | $imports = $xpath 249 | ->query('//schema:import') 250 | ->expectAllOfType(DOMElement::class); 251 | 252 | foreach (reverse($imports) as $import) { 253 | $parentSchema = assert_element($import->parentNode); 254 | $parentSchema->prepend($import); 255 | } 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /src/Xml/Exception/FlattenException.php: -------------------------------------------------------------------------------- 1 | toUnsafeDocument(), 29 | pipe( 30 | utf8(), 31 | when( 32 | static fn (DOMDocument $document): bool => $document->documentElement->localName === 'definitions', 33 | pipe( 34 | (new FlattenWsdlImports($location, $context))(...), 35 | (new FlattenTypes())(...), 36 | (new FlattenXsdImports($location, $context))(...), 37 | ), 38 | (new FlattenXsdImports($location, $context))(...) 39 | ) 40 | ) 41 | )->toXmlString(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Xml/Validator/SchemaSyntaxValidator.php: -------------------------------------------------------------------------------- 1 | xsd = $xsd ?? dirname(__DIR__, 3).'/xsd/XMLSchema.xsd'; 26 | } 27 | 28 | /** 29 | * @throws RuntimeException 30 | */ 31 | public function __invoke(DOMDocument $document): IssueCollection 32 | { 33 | $xml = Document::fromUnsafeDocument($document); 34 | $xpath = $xml->xpath(new WsdlPreset($xml)); 35 | 36 | return $xpath 37 | ->query('//schema:schema') 38 | ->expectAllOfType(DOMElement::class) 39 | ->reduce( 40 | fn (IssueCollection $issues, DOMElement $schema) => new IssueCollection( 41 | ...$issues, 42 | ...Document::fromXmlNode($schema)->validate(xsd_validator($this->xsd)) 43 | ), 44 | new IssueCollection() 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Xml/Validator/WsdlSyntaxValidator.php: -------------------------------------------------------------------------------- 1 | xsd = $xsd ?? dirname(__DIR__, 3).'/xsd/wsdl.xsd'; 24 | } 25 | 26 | /** 27 | * @throws RuntimeException 28 | */ 29 | public function __invoke(DOMDocument $document): IssueCollection 30 | { 31 | return Document::fromUnsafeDocument($document)->validate(xsd_validator($this->xsd)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Xml/Visitor/ReprefixTypeQname.php: -------------------------------------------------------------------------------- 1 | $prefixMap - "From" key - "To" value prefix map 14 | */ 15 | public function __construct( 16 | private readonly array $prefixMap 17 | ) { 18 | } 19 | 20 | public function onNodeEnter(DOMNode $node): Action 21 | { 22 | if (!is_attribute($node) || $node->localName !== 'type') { 23 | return new Action\Noop(); 24 | } 25 | 26 | $parts = explode(':', $node->nodeValue ?? '', 2); 27 | if (count($parts) !== 2) { 28 | return new Action\Noop(); 29 | } 30 | 31 | [$currentPrefix, $currentTypeName] = $parts; 32 | if (!array_key_exists($currentPrefix, $this->prefixMap)) { 33 | return new Action\Noop(); 34 | } 35 | 36 | $node->nodeValue = $this->prefixMap[$currentPrefix].':'.$currentTypeName; 37 | 38 | return new Action\Noop(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Xml/Xmlns/FixRemovedDefaultXmlnsDeclarationsDuringImport.php: -------------------------------------------------------------------------------- 1 | getAttribute('xmlns') || $target->hasAttribute('xmlns')) { 25 | return; 26 | } 27 | 28 | $target->setAttribute('xmlns', $source->getAttribute('xmlns')); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Xml/Xmlns/RegisterNonConflictingXmlnsNamespaces.php: -------------------------------------------------------------------------------- 1 | 30 | */ 31 | final class RegisterNonConflictingXmlnsNamespaces 32 | { 33 | /** 34 | * @throws RuntimeException 35 | */ 36 | public function __invoke(DOMElement $existingSchema, DOMElement $newSchema): void 37 | { 38 | $existingLinkedNamespaces = linked_namespaces($existingSchema); 39 | 40 | $rePrefixMap = linked_namespaces($newSchema)->reduce( 41 | /** 42 | * @param RePrefixMap $rePrefixMap 43 | * @return RePrefixMap 44 | */ 45 | function (array $rePrefixMap, DOMNameSpaceNode $xmlns) use ($existingSchema, $existingLinkedNamespaces): array { 46 | // Skip non-named xmlns attributes: 47 | if (!$xmlns->prefix) { 48 | return $rePrefixMap; 49 | } 50 | 51 | // Check for duplicates: 52 | if ($existingSchema->hasAttribute($xmlns->nodeName) && $existingSchema->getAttribute($xmlns->nodeName) !== $xmlns->prefix) { 53 | return merge( 54 | $rePrefixMap, 55 | // Can be improved with orElse when we are using PSL V3. 56 | $this->tryUsingExistingPrefix($existingLinkedNamespaces, $xmlns) 57 | ->unwrapOrElse( 58 | fn () => $this->tryUsingUniquePrefixHash($existingSchema, $xmlns) 59 | ->unwrapOrElse( 60 | static fn () => throw new RuntimeException('Could not resolve conflicting namespace declarations whilst flattening your WSDL file.') 61 | ) 62 | ) 63 | ); 64 | } 65 | 66 | xmlns_attribute($xmlns->prefix, $xmlns->namespaceURI)($existingSchema); 67 | 68 | return $rePrefixMap; 69 | }, 70 | [] 71 | ); 72 | 73 | if (count($rePrefixMap)) { 74 | Document::fromUnsafeDocument($newSchema->ownerDocument)->traverse(new ReprefixTypeQname($rePrefixMap)); 75 | } 76 | (new FixRemovedDefaultXmlnsDeclarationsDuringImport())($existingSchema, $newSchema); 77 | } 78 | 79 | /** 80 | * @param NodeList $existingLinkedNamespaces 81 | * 82 | * @return Option 83 | */ 84 | private function tryUsingExistingPrefix( 85 | NodeList $existingLinkedNamespaces, 86 | DOMNameSpaceNode $xmlns 87 | ): Option { 88 | $existingPrefix = $existingLinkedNamespaces->filter( 89 | static fn (DOMNameSpaceNode $node) => $node->namespaceURI === $xmlns->namespaceURI 90 | )->first()?->prefix; 91 | 92 | if ($existingPrefix === null) { 93 | /** @var Option */ 94 | return none(); 95 | } 96 | 97 | /** @var Option */ 98 | return some([$xmlns->prefix => $existingPrefix]); 99 | } 100 | 101 | /** 102 | * @return Option 103 | * 104 | * @throws RuntimeException 105 | */ 106 | private function tryUsingUniquePrefixHash( 107 | DOMElement $existingSchema, 108 | DOMNameSpaceNode $xmlns 109 | ): Option { 110 | $uniquePrefix = 'ns' . substr(md5($xmlns->namespaceURI), 0, 8); 111 | if ($existingSchema->hasAttribute('xmlns:'.$uniquePrefix)) { 112 | /** @var Option */ 113 | return none(); 114 | } 115 | 116 | $this->copyXmlnsDeclaration($existingSchema, $xmlns->namespaceURI, $uniquePrefix); 117 | 118 | /** @var Option */ 119 | return some([$xmlns->prefix => $uniquePrefix]); 120 | } 121 | 122 | /** 123 | * @throws RuntimeException 124 | */ 125 | private function copyXmlnsDeclaration(DOMElement $existingSchema, string $namespaceUri, string $prefix): void 126 | { 127 | xmlns_attribute($prefix, $namespaceUri)($existingSchema); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /stubs/dom.phpstub: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 48 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | ]> 69 | 70 | 71 | 72 | Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp 73 | Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp 74 | 75 | 76 | 77 | 78 | 79 | The schema corresponding to this document is normative, 80 | with respect to the syntactic constraints it expresses in the 81 | XML Schema language. The documentation (within <documentation> elements) 82 | below, is not normative, but rather highlights important aspects of 83 | the W3C Recommendation of which this is a part 84 | 85 | 86 | 87 | 88 | The simpleType element and all of its members are defined 89 | towards the end of this schema document 90 | 91 | 92 | 93 | 94 | 95 | Get access to the xml: attribute groups for xml:lang 96 | as declared on 'schema' and 'documentation' below 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | This type is extended by almost all schema types 105 | to allow attributes from other namespaces to be 106 | added to user schemas. 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | This type is extended by all types which allow annotation 120 | other than <schema> itself 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | This group is for the 137 | elements which occur freely at the top level of schemas. 138 | All of their types are based on the "annotated" type by extension. 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | This group is for the 152 | elements which can self-redefine (see <redefine> below). 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | A utility type, not for public use 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | A utility type, not for public use 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | A utility type, not for public use 188 | 189 | #all or (possibly empty) subset of {extension, restriction} 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | A utility type, not for public use 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | A utility type, not for public use 220 | 221 | #all or (possibly empty) subset of {extension, restriction, list, union} 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | for maxOccurs 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | for all particles 318 | 319 | 320 | 321 | 322 | 323 | 324 | for element, group and attributeGroup, 325 | which both define and reference 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 'complexType' uses this 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | This branch is short for 429 | <complexContent> 430 | <restriction base="xs:anyType"> 431 | ... 432 | </restriction> 433 | </complexContent> 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | Will be restricted to required or forbidden 449 | 450 | 451 | 452 | 453 | 454 | Not allowed if simpleContent child is chosen. 455 | May be overriden by setting on complexContent child. 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | This choice is added simply to 517 | make this a valid restriction per the REC 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | Overrides any setting on complexType parent. 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | This choice is added simply to 570 | make this a valid restriction per the REC 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | No typeDefParticle group reference 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | A utility type, not for public use 624 | 625 | #all or (possibly empty) subset of {substitution, extension, 626 | restriction} 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | The element element can be used either 652 | at the top level to define an element-type binding globally, 653 | or within a content model to either reference a globally-defined 654 | element or type or declare an element-type binding locally. 655 | The ref form is not allowed at the top level. 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | group type for explicit groups, named top-level groups and 732 | group references 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | group type for the three kinds of group 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | This choice with min/max is here to 841 | avoid a pblm with the Elt:All/Choice/Seq 842 | Particle derivation constraint 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | restricted max/min 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | Only elements allowed inside 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | simple type for the value of the 'namespace' attr of 970 | 'any' and 'anyAttribute' 971 | 972 | 973 | 974 | Value is 975 | ##any - - any non-conflicting WFXML/attribute at all 976 | 977 | ##other - - any non-conflicting WFXML/attribute from 978 | namespace other than targetNS 979 | 980 | ##local - - any unqualified non-conflicting WFXML/attribute 981 | 982 | one or - - any non-conflicting WFXML/attribute from 983 | more URI the listed namespaces 984 | references 985 | (space separated) 986 | 987 | ##targetNamespace or ##local may appear in the above list, to 988 | refer to the targetNamespace of the enclosing 989 | schema or an absent targetNamespace respectively 990 | 991 | 992 | 993 | 994 | 995 | A utility type, not for public use 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | A subset of XPath expressions for use 1125 | in selectors 1126 | A utility type, not for public 1127 | use 1128 | 1129 | 1130 | 1131 | The following pattern is intended to allow XPath 1132 | expressions per the following EBNF: 1133 | Selector ::= Path ( '|' Path )* 1134 | Path ::= ('.//')? Step ( '/' Step )* 1135 | Step ::= '.' | NameTest 1136 | NameTest ::= QName | '*' | NCName ':' '*' 1137 | child:: is also allowed 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | A subset of XPath expressions for use 1161 | in fields 1162 | A utility type, not for public 1163 | use 1164 | 1165 | 1166 | 1167 | The following pattern is intended to allow XPath 1168 | expressions per the same EBNF as for selector, 1169 | with the following change: 1170 | Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest ) 1171 | 1172 | 1173 | 1174 | 1175 | 1176 | 1177 | 1178 | 1179 | 1180 | 1181 | 1182 | 1183 | 1184 | 1185 | 1186 | 1187 | 1188 | 1189 | 1190 | 1191 | 1192 | 1193 | 1194 | 1195 | 1196 | 1197 | The three kinds of identity constraints, all with 1198 | type of or derived from 'keybase'. 1199 | 1200 | 1201 | 1202 | 1203 | 1204 | 1205 | 1206 | 1207 | 1208 | 1209 | 1210 | 1211 | 1212 | 1213 | 1214 | 1215 | 1216 | 1217 | 1218 | 1219 | 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | 1241 | 1242 | 1243 | 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | A utility type, not for public use 1250 | 1251 | A public identifier, per ISO 8879 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1275 | 1276 | 1277 | 1278 | 1279 | 1280 | 1281 | 1282 | 1283 | 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | 1290 | 1291 | 1292 | 1293 | 1294 | 1295 | 1296 | 1297 | 1298 | 1299 | 1300 | 1301 | 1302 | notations for use within XML Schema schemas 1303 | 1304 | 1305 | 1306 | 1307 | 1308 | 1309 | 1310 | 1311 | Not the real urType, but as close an approximation as we can 1312 | get in the XML representation 1313 | 1314 | 1315 | 1316 | 1317 | 1318 | 1319 | 1320 | 1321 | 1322 | First the built-in primitive datatypes. These definitions are for 1323 | information only, the real built-in definitions are magic. 1324 | 1325 | 1326 | 1327 | For each built-in datatype in this schema (both primitive and 1328 | derived) can be uniquely addressed via a URI constructed 1329 | as follows: 1330 | 1) the base URI is the URI of the XML Schema namespace 1331 | 2) the fragment identifier is the name of the datatype 1332 | 1333 | For example, to address the int datatype, the URI is: 1334 | 1335 | http://www.w3.org/2001/XMLSchema#int 1336 | 1337 | Additionally, each facet definition element can be uniquely 1338 | addressed via a URI constructed as follows: 1339 | 1) the base URI is the URI of the XML Schema namespace 1340 | 2) the fragment identifier is the name of the facet 1341 | 1342 | For example, to address the maxInclusive facet, the URI is: 1343 | 1344 | http://www.w3.org/2001/XMLSchema#maxInclusive 1345 | 1346 | Additionally, each facet usage in a built-in datatype definition 1347 | can be uniquely addressed via a URI constructed as follows: 1348 | 1) the base URI is the URI of the XML Schema namespace 1349 | 2) the fragment identifier is the name of the datatype, followed 1350 | by a period (".") followed by the name of the facet 1351 | 1352 | For example, to address the usage of the maxInclusive facet in 1353 | the definition of int, the URI is: 1354 | 1355 | http://www.w3.org/2001/XMLSchema#int.maxInclusive 1356 | 1357 | 1358 | 1359 | 1360 | 1361 | 1362 | 1363 | 1364 | 1365 | 1366 | 1367 | 1368 | 1369 | 1370 | 1371 | 1372 | 1373 | 1374 | 1376 | 1377 | 1378 | 1379 | 1380 | 1381 | 1382 | 1383 | 1384 | 1385 | 1386 | 1387 | 1388 | 1389 | 1390 | 1391 | 1392 | 1394 | 1395 | 1396 | 1398 | 1399 | 1400 | 1401 | 1402 | 1403 | 1404 | 1405 | 1406 | 1407 | 1408 | 1409 | 1410 | 1411 | 1412 | 1413 | 1414 | 1415 | 1416 | 1418 | 1419 | 1420 | 1422 | 1423 | 1424 | 1425 | 1426 | 1427 | 1428 | 1429 | 1430 | 1431 | 1432 | 1433 | 1434 | 1435 | 1436 | 1437 | 1438 | 1439 | 1440 | 1442 | 1443 | 1444 | 1446 | 1447 | 1448 | 1449 | 1450 | 1451 | 1452 | 1453 | 1454 | 1455 | 1456 | 1457 | 1458 | 1459 | 1460 | 1461 | 1462 | 1463 | 1465 | 1466 | 1467 | 1469 | 1470 | 1471 | 1473 | 1474 | 1475 | 1476 | 1477 | 1478 | 1479 | 1480 | 1481 | 1482 | 1483 | 1484 | 1485 | 1486 | 1487 | 1488 | 1490 | 1491 | 1492 | 1494 | 1495 | 1496 | 1498 | 1499 | 1500 | 1501 | 1502 | 1503 | 1504 | 1505 | 1506 | 1507 | 1508 | 1509 | 1510 | 1511 | 1512 | 1513 | 1515 | 1516 | 1517 | 1519 | 1520 | 1521 | 1523 | 1524 | 1525 | 1526 | 1527 | 1528 | 1529 | 1530 | 1531 | 1532 | 1533 | 1534 | 1535 | 1536 | 1537 | 1538 | 1540 | 1541 | 1542 | 1544 | 1545 | 1546 | 1548 | 1549 | 1550 | 1551 | 1552 | 1553 | 1554 | 1555 | 1556 | 1557 | 1558 | 1559 | 1560 | 1561 | 1562 | 1563 | 1565 | 1566 | 1567 | 1569 | 1570 | 1571 | 1573 | 1574 | 1575 | 1576 | 1577 | 1578 | 1579 | 1580 | 1581 | 1582 | 1583 | 1584 | 1585 | 1586 | 1587 | 1588 | 1590 | 1591 | 1592 | 1594 | 1595 | 1596 | 1598 | 1599 | 1600 | 1601 | 1602 | 1603 | 1604 | 1605 | 1606 | 1607 | 1608 | 1609 | 1610 | 1611 | 1612 | 1613 | 1615 | 1616 | 1617 | 1619 | 1620 | 1621 | 1623 | 1624 | 1625 | 1626 | 1627 | 1628 | 1629 | 1630 | 1631 | 1632 | 1633 | 1634 | 1635 | 1636 | 1637 | 1638 | 1640 | 1641 | 1642 | 1644 | 1645 | 1646 | 1648 | 1649 | 1650 | 1651 | 1652 | 1653 | 1654 | 1655 | 1656 | 1657 | 1658 | 1659 | 1660 | 1661 | 1662 | 1663 | 1665 | 1666 | 1667 | 1669 | 1670 | 1671 | 1673 | 1674 | 1675 | 1676 | 1677 | 1678 | 1679 | 1680 | 1681 | 1682 | 1683 | 1684 | 1685 | 1686 | 1687 | 1688 | 1690 | 1691 | 1692 | 1694 | 1695 | 1696 | 1698 | 1699 | 1700 | 1701 | 1702 | 1703 | 1704 | 1705 | 1706 | 1707 | 1708 | 1709 | 1710 | 1711 | 1712 | 1714 | 1715 | 1716 | 1718 | 1719 | 1720 | 1722 | 1723 | 1724 | 1725 | 1726 | 1727 | 1728 | 1729 | 1730 | 1731 | 1732 | 1733 | 1734 | 1735 | 1736 | 1738 | 1739 | 1740 | 1742 | 1743 | 1744 | 1746 | 1747 | 1748 | 1749 | 1750 | 1751 | 1752 | 1753 | 1754 | 1755 | 1756 | 1757 | 1758 | 1759 | 1760 | 1762 | 1763 | 1764 | 1766 | 1767 | 1768 | 1770 | 1771 | 1772 | 1773 | 1774 | 1775 | 1776 | 1777 | 1778 | 1779 | 1780 | 1781 | 1782 | 1783 | 1784 | 1786 | 1787 | 1788 | 1790 | 1791 | 1792 | 1794 | 1795 | 1796 | 1797 | 1798 | 1799 | 1800 | 1801 | 1802 | 1803 | 1804 | 1805 | 1806 | 1807 | 1808 | 1810 | 1811 | 1812 | 1814 | 1815 | NOTATION cannot be used directly in a schema; rather a type 1816 | must be derived from it by specifying at least one enumeration 1817 | facet whose value is the name of a NOTATION declared in the 1818 | schema. 1819 | 1820 | 1821 | 1822 | 1824 | 1825 | 1826 | 1827 | 1828 | 1829 | Now the derived primitive types 1830 | 1831 | 1832 | 1833 | 1834 | 1835 | 1837 | 1838 | 1839 | 1841 | 1842 | 1843 | 1844 | 1845 | 1846 | 1848 | 1849 | 1850 | 1851 | 1852 | 1853 | 1854 | 1855 | 1856 | 1858 | 1859 | 1860 | 1863 | 1864 | 1866 | pattern specifies the content of section 2.12 of XML 1.0e2 1867 | and RFC 3066 (Revised version of RFC 1766). 1868 | 1869 | 1870 | 1871 | 1872 | 1873 | 1874 | 1875 | 1876 | 1877 | 1878 | 1879 | 1880 | 1881 | 1882 | 1883 | 1884 | 1885 | 1887 | 1888 | 1889 | 1891 | 1892 | 1893 | 1894 | 1895 | 1896 | 1897 | 1898 | 1899 | 1900 | 1901 | 1902 | 1903 | 1904 | 1905 | 1906 | 1907 | 1908 | 1909 | 1910 | 1911 | 1913 | 1914 | 1915 | 1917 | 1918 | 1919 | 1920 | 1921 | 1922 | 1923 | 1924 | 1925 | 1926 | 1927 | 1928 | 1930 | 1931 | 1932 | 1933 | 1934 | 1936 | pattern matches production 7 from the XML spec 1937 | 1938 | 1939 | 1940 | 1941 | 1942 | 1943 | 1944 | 1945 | 1946 | 1947 | 1948 | 1949 | 1950 | 1951 | 1952 | 1953 | 1954 | 1956 | 1957 | 1958 | 1960 | 1961 | 1962 | 1963 | 1964 | 1965 | 1966 | 1967 | 1968 | 1969 | 1970 | 1971 | 1973 | 1974 | 1975 | 1976 | 1977 | 1979 | pattern matches production 5 from the XML spec 1980 | 1981 | 1982 | 1983 | 1984 | 1985 | 1986 | 1987 | 1988 | 1990 | 1991 | 1992 | 1993 | 1994 | 1996 | pattern matches production 4 from the Namespaces in XML spec 1997 | 1998 | 1999 | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | 2013 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2023 | 2024 | 2025 | 2026 | 2027 | 2028 | 2029 | 2031 | 2032 | 2033 | 2034 | 2035 | 2036 | 2037 | 2038 | 2039 | 2040 | 2042 | 2043 | 2044 | 2045 | 2046 | 2047 | 2048 | 2049 | 2050 | 2052 | 2053 | 2054 | 2055 | 2056 | 2057 | 2058 | 2059 | 2060 | 2061 | 2062 | 2063 | 2064 | 2066 | 2067 | 2068 | 2069 | 2070 | 2071 | 2072 | 2073 | 2074 | 2075 | 2077 | 2078 | 2079 | 2080 | 2081 | 2082 | 2083 | 2084 | 2085 | 2086 | 2088 | 2089 | 2090 | 2091 | 2092 | 2093 | 2094 | 2095 | 2096 | 2097 | 2099 | 2100 | 2101 | 2102 | 2103 | 2104 | 2105 | 2106 | 2107 | 2108 | 2110 | 2111 | 2112 | 2113 | 2114 | 2115 | 2116 | 2117 | 2118 | 2119 | 2120 | 2121 | 2122 | 2124 | 2125 | 2126 | 2128 | 2129 | 2130 | 2131 | 2132 | 2133 | 2135 | 2136 | 2137 | 2139 | 2140 | 2141 | 2142 | 2143 | 2144 | 2146 | 2147 | 2148 | 2150 | 2151 | 2152 | 2153 | 2154 | 2155 | 2157 | 2158 | 2159 | 2160 | 2161 | 2162 | 2163 | 2164 | 2165 | 2167 | 2168 | 2169 | 2170 | 2171 | 2172 | 2173 | 2174 | 2175 | 2176 | A utility type, not for public use 2177 | 2178 | 2179 | 2180 | 2181 | 2182 | 2183 | 2184 | 2185 | 2186 | 2187 | 2188 | 2189 | 2190 | 2191 | 2192 | 2193 | 2194 | 2195 | 2196 | 2197 | 2198 | #all or (possibly empty) subset of {restriction, union, list} 2199 | 2200 | 2201 | A utility type, not for public use 2202 | 2203 | 2204 | 2205 | 2206 | 2207 | 2208 | 2209 | 2210 | 2211 | 2212 | 2213 | 2214 | 2215 | 2216 | 2217 | 2218 | 2219 | 2220 | 2221 | 2222 | 2223 | 2224 | 2225 | 2226 | 2227 | 2228 | 2229 | 2230 | 2231 | Can be restricted to required or forbidden 2232 | 2233 | 2234 | 2235 | 2236 | 2237 | 2238 | 2239 | 2240 | 2241 | 2242 | 2243 | 2244 | 2245 | 2246 | 2248 | 2249 | 2250 | Required at the top level 2251 | 2252 | 2253 | 2254 | 2255 | 2256 | 2257 | 2258 | 2259 | 2260 | 2261 | 2262 | 2263 | 2264 | 2265 | 2266 | 2267 | 2268 | 2269 | Forbidden when nested 2270 | 2271 | 2272 | 2273 | 2274 | 2275 | 2276 | 2277 | 2278 | 2279 | 2280 | 2281 | 2283 | 2284 | 2285 | 2286 | 2287 | 2288 | 2289 | We should use a substitution group for facets, but 2290 | that's ruled out because it would allow users to 2291 | add their own, which we're not ready for yet. 2292 | 2293 | 2294 | 2295 | 2296 | 2297 | 2298 | 2299 | 2300 | 2301 | 2302 | 2303 | 2304 | 2305 | 2306 | 2307 | 2308 | 2309 | 2310 | 2311 | 2312 | 2313 | 2314 | 2315 | 2316 | 2317 | 2318 | 2319 | 2320 | 2322 | base attribute and simpleType child are mutually 2323 | exclusive, but one or other is required 2324 | 2325 | 2326 | 2327 | 2328 | 2329 | 2330 | 2331 | 2332 | 2333 | 2334 | 2335 | 2336 | 2337 | 2338 | 2340 | itemType attribute and simpleType child are mutually 2341 | exclusive, but one or other is required 2342 | 2343 | 2344 | 2345 | 2346 | 2347 | 2349 | 2350 | 2351 | 2352 | 2353 | 2354 | 2355 | 2356 | 2357 | 2358 | 2359 | 2361 | memberTypes attribute must be non-empty or there must be 2362 | at least one simpleType child 2363 | 2364 | 2365 | 2366 | 2367 | 2368 | 2370 | 2371 | 2372 | 2373 | 2374 | 2375 | 2376 | 2377 | 2378 | 2379 | 2380 | 2381 | 2382 | 2383 | 2384 | 2385 | 2387 | 2388 | 2389 | 2390 | 2391 | 2392 | 2393 | 2394 | 2395 | 2396 | 2397 | 2398 | 2399 | 2400 | 2401 | 2402 | 2403 | 2404 | 2405 | 2407 | 2408 | 2409 | 2410 | 2411 | 2413 | 2414 | 2415 | 2416 | 2417 | 2418 | 2420 | 2421 | 2422 | 2423 | 2424 | 2426 | 2427 | 2428 | 2429 | 2430 | 2431 | 2432 | 2433 | 2434 | 2435 | 2436 | 2437 | 2438 | 2439 | 2440 | 2441 | 2442 | 2443 | 2445 | 2446 | 2447 | 2448 | 2449 | 2450 | 2451 | 2452 | 2453 | 2454 | 2455 | 2456 | 2457 | 2458 | 2459 | 2460 | 2462 | 2463 | 2464 | 2465 | 2466 | 2467 | 2469 | 2470 | 2471 | 2472 | 2473 | 2475 | 2476 | 2477 | 2478 | 2479 | 2481 | 2482 | 2483 | 2484 | 2485 | 2486 | 2488 | 2489 | 2490 | 2491 | 2492 | 2493 | 2495 | 2496 | 2497 | 2498 | 2499 | 2500 | 2501 | 2502 | 2503 | 2504 | 2505 | 2506 | 2507 | 2508 | 2509 | 2510 | 2511 | 2512 | 2513 | 2514 | 2515 | 2516 | 2517 | 2518 | 2519 | 2521 | 2522 | 2523 | 2524 | 2525 | 2526 | 2527 | 2528 | 2529 | 2530 | 2531 | 2532 | 2533 | 2534 | 2535 | 2536 | -------------------------------------------------------------------------------- /xsd/oasis-200401-wss-wssecurity-secext-1.0.xsd: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | This type represents an element with arbitrary attributes. 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | This type is used for password elements per Section 4.1. 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | This type is used for elements containing stringified binary data. 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | This type represents a username token per Section 4.1 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | A security token that is encoded in binary 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | A security token key identifier 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | Typedef to allow a list of usages (as URIs). 79 | 80 | 81 | 82 | 83 | 84 | This global attribute is used to indicate the usage of a referenced or indicated token within the containing context 85 | 86 | 87 | 88 | 89 | This type represents a reference to an external security token. 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | This type represents a reference to an embedded security token. 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | This type is used reference a security token. 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | This complexType defines header block to use for security-relevant data directed at a specific SOAP actor. 119 | 120 | 121 | 122 | 123 | The use of "any" is to allow extensibility and different forms of security data. 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | This complexType defines a container for elements to be specified from any namespace as properties/parameters of a DSIG transformation. 132 | 133 | 134 | 135 | 136 | The use of "any" is to allow extensibility from any namespace. 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | This element defines the wsse:UsernameToken element per Section 4.1. 145 | 146 | 147 | 148 | 149 | This element defines the wsse:BinarySecurityToken element per Section 4.2. 150 | 151 | 152 | 153 | 154 | This element defines a security token reference 155 | 156 | 157 | 158 | 159 | This element defines a security token embedded reference 160 | 161 | 162 | 163 | 164 | This element defines a key identifier reference 165 | 166 | 167 | 168 | 169 | This element defines the wsse:SecurityTokenReference per Section 4.3. 170 | 171 | 172 | 173 | 174 | This element defines the wsse:Security SOAP header element per Section 4. 175 | 176 | 177 | 178 | 179 | This element contains properties for transformations from any namespace, including DSIG. 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | -------------------------------------------------------------------------------- /xsd/oasis-200401-wss-wssecurity-utility-1.0.xsd: -------------------------------------------------------------------------------- 1 |  2 | 10 | 16 | 17 | 18 | 19 | 20 | This type defines the fault code value for Timestamp message expiration. 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | This global attribute supports annotating arbitrary elements with an ID. 32 | 33 | 34 | 35 | 36 | 37 | 38 | Convenience attribute group used to simplify this schema. 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | This type is for elements whose [children] is a psuedo-dateTime and can have arbitrary attributes. 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | This type is for elements whose [children] is an anyURI and can have arbitrary attributes. 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | This complex type ties together the timestamp related elements into a composite type. 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | This element allows Timestamps to be applied anywhere element wildcards are present, 89 | including as a SOAP header. 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | This element allows an expiration time to be applied anywhere element wildcards are present. 98 | 99 | 100 | 101 | 102 | 103 | 104 | This element allows a creation time to be applied anywhere element wildcards are present. 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /xsd/soap11-envelope.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | Prose in the spec does not specify that attributes are allowed on the Body element 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 'encodingStyle' indicates any canonicalization conventions followed in the contents of the containing element. For example, the value 'http://schemas.xmlsoap.org/soap/encoding/' indicates the pattern described in SOAP specification 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | Fault reporting structure 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /xsd/wsdl.xsd: -------------------------------------------------------------------------------- 1 | 2 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | This type is extended by component types to allow them to be documented 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | This type is extended by component types to allow attributes from other namespaces to be added. 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | This type is extended by component types to allow elements from other namespaces to be added. 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | Any top level optional element allowed to appear more then once - any child of definitions element except wsdl:types. Any extensibility element is allowed in any place. 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | -------------------------------------------------------------------------------- /xsd/xml.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 |
11 |

About the XML namespace

12 | 13 |
14 |

15 | This schema document describes the XML namespace, in a form 16 | suitable for import by other schema documents. 17 |

18 |

19 | See 20 | http://www.w3.org/XML/1998/namespace.html and 21 | 22 | http://www.w3.org/TR/REC-xml for information 23 | about this namespace. 24 |

25 |

26 | Note that local names in this namespace are intended to be 27 | defined only by the World Wide Web Consortium or its subgroups. 28 | The names currently defined in this namespace are listed below. 29 | They should not be used with conflicting semantics by any Working 30 | Group, specification, or document instance. 31 |

32 |

33 | See further below in this document for more information about how to refer to this schema document from your own 35 | XSD schema documents and about the 36 | namespace-versioning policy governing this schema document. 37 |

38 |
39 |
40 |
41 |
42 | 43 | 44 | 45 | 46 |
47 | 48 |

lang (as an attribute name)

49 |

50 | denotes an attribute whose value 51 | is a language code for the natural language of the content of 52 | any element; its value is inherited. This name is reserved 53 | by virtue of its definition in the XML specification.

54 | 55 |
56 |
57 |

Notes

58 |

59 | Attempting to install the relevant ISO 2- and 3-letter 60 | codes as the enumerated possible values is probably never 61 | going to be a realistic possibility. 62 |

63 |

64 | See BCP 47 at 65 | http://www.rfc-editor.org/rfc/bcp/bcp47.txt 66 | and the IANA language subtag registry at 67 | 68 | http://www.iana.org/assignments/language-subtag-registry 69 | for further information. 70 |

71 |

72 | The union allows for the 'un-declaration' of xml:lang with 73 | the empty string. 74 |

75 |
76 |
77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
88 | 89 | 90 | 91 | 92 |
93 | 94 |

space (as an attribute name)

95 |

96 | denotes an attribute whose 97 | value is a keyword indicating what whitespace processing 98 | discipline is intended for the content of the element; its 99 | value is inherited. This name is reserved by virtue of its 100 | definition in the XML specification.

101 | 102 |
103 |
104 |
105 | 106 | 107 | 108 | 109 | 110 | 111 |
112 | 113 | 114 | 115 |
116 | 117 |

base (as an attribute name)

118 |

119 | denotes an attribute whose value 120 | provides a URI to be used as the base for interpreting any 121 | relative URIs in the scope of the element on which it 122 | appears; its value is inherited. This name is reserved 123 | by virtue of its definition in the XML Base specification.

124 | 125 |

126 | See http://www.w3.org/TR/xmlbase/ 128 | for information about this attribute. 129 |

130 |
131 |
132 |
133 |
134 | 135 | 136 | 137 | 138 |
139 | 140 |

id (as an attribute name)

141 |

142 | denotes an attribute whose value 143 | should be interpreted as if declared to be of type ID. 144 | This name is reserved by virtue of its definition in the 145 | xml:id specification.

146 | 147 |

148 | See http://www.w3.org/TR/xml-id/ 150 | for information about this attribute. 151 |

152 |
153 |
154 |
155 |
156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 |
167 | 168 |

Father (in any context at all)

169 | 170 |
171 |

172 | denotes Jon Bosak, the chair of 173 | the original XML Working Group. This name is reserved by 174 | the following decision of the W3C XML Plenary and 175 | XML Coordination groups: 176 |

177 |
178 |

179 | In appreciation for his vision, leadership and 180 | dedication the W3C XML Plenary on this 10th day of 181 | February, 2000, reserves for Jon Bosak in perpetuity 182 | the XML name "xml:Father". 183 |

184 |
185 |
186 |
187 |
188 |
189 | 190 | 191 | 192 |
193 |

About this schema document

194 | 195 |
196 |

197 | This schema defines attributes and an attribute group suitable 198 | for use by schemas wishing to allow xml:base, 199 | xml:lang, xml:space or 200 | xml:id attributes on elements they define. 201 |

202 |

203 | To enable this, such a schema must import this schema for 204 | the XML namespace, e.g. as follows: 205 |

206 |
207 |           <schema . . .>
208 |            . . .
209 |            <import namespace="http://www.w3.org/XML/1998/namespace"
210 |                       schemaLocation="http://www.w3.org/2001/xml.xsd"/>
211 |      
212 |

213 | or 214 |

215 |
216 |            <import namespace="http://www.w3.org/XML/1998/namespace"
217 |                       schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
218 |      
219 |

220 | Subsequently, qualified reference to any of the attributes or the 221 | group defined below will have the desired effect, e.g. 222 |

223 |
224 |           <type . . .>
225 |            . . .
226 |            <attributeGroup ref="xml:specialAttrs"/>
227 |      
228 |

229 | will define a type which will schema-validate an instance element 230 | with any of those attributes. 231 |

232 |
233 |
234 |
235 |
236 | 237 | 238 | 239 |
240 |

Versioning policy for this schema document

241 |
242 |

243 | In keeping with the XML Schema WG's standard versioning 244 | policy, this schema document will persist at 245 | 246 | http://www.w3.org/2009/01/xml.xsd. 247 |

248 |

249 | At the date of issue it can also be found at 250 | 251 | http://www.w3.org/2001/xml.xsd. 252 |

253 |

254 | The schema document at that URI may however change in the future, 255 | in order to remain compatible with the latest version of XML 256 | Schema itself, or with the XML namespace itself. In other words, 257 | if the XML Schema or XML namespaces change, the version of this 258 | document at 259 | http://www.w3.org/2001/xml.xsd 260 | 261 | will change accordingly; the version at 262 | 263 | http://www.w3.org/2009/01/xml.xsd 264 | 265 | will not change. 266 |

267 |

268 | Previous dated (and unchanging) versions of this schema 269 | document are at: 270 |

271 | 281 |
282 |
283 |
284 |
285 | 286 |
287 | 288 | -------------------------------------------------------------------------------- /xsd/xmldsig-core-schema.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | ]> 11 | 12 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 216 | 217 | 218 | 219 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | --------------------------------------------------------------------------------