Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding types in default namespaces #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Schema/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function findSomethingNoThrow(
return $this->typeCache[$cid];
}

if ($this->getTargetNamespace() === $namespace) {
if ($this->getTargetNamespace() === $namespace || $namespace === null) {
/**
* @var SchemaItem|null $item
*/
Expand Down
2 changes: 1 addition & 1 deletion src/SchemaReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ private static function splitParts(\DOMElement $node, string $typeName): array

// If no namespace is found, throw an exception only if a prefix was provided.
// If no prefix was provided and the above lookup failed, this means that there
// was no defalut namespace defined, making the element part of no namespace.
// was no default namespace defined, making the element part of no namespace.
// In this case, we should not throw an exception since this is valid xml.
if (!$namespace && null !== $prefix) {
throw new TypeException(sprintf("Can't find namespace for prefix '%s', at line %d in %s ", $prefix, $node->getLineNo(), $node->ownerDocument->documentURI));
Expand Down
Loading