-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Collect meta attributes from XSD files #83
Conversation
src/SchemaReader.php
Outdated
@@ -1088,6 +1108,19 @@ private function findType(Schema $schema, \DOMElement $node, string $typeName): | |||
throw new TypeException(sprintf("Can't find %s named {%s}#%s, at line %d in %s ", 'type', $namespace, $name, $node->getLineNo(), $node->ownerDocument->documentURI)); | |||
} | |||
|
|||
public function findSchemaForNamespace(Schema $currentSchema, string $namespace): Schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There currently was no way to get a schema based on a namespace URI.
Not sure if this is the best way, but couldn't really find a different way.
77c4552
to
f88e21e
Compare
…d when requesting the meta data.
I think that there are way too many possibilities here (nodes, attributes) to fit them in the "metadata", have you considered exposing the underlying DOM Node and let the consumer parse as it prefers? Having just something as |
I agree that metadata might not be the best name for the data. Maybe rather something like I was trying to build code in line of what there is in the package today. However, it could make sense to introduce the link to the node so that people can collect whatever they want from the XML directly. Let me know what you all prefer, I can take a look at creating an alternative PR for the node implementation. |
Just took an additional look and found a "con" argument for the node approach: having the node only is a bit harder because of the difference between reference and definition schema items. When it is pre-parsed, the information gets proxies instantly. |
By looking at https://www.w3schools.com/xml/el_complextype.asp it seems that XMLSchema allows only attributes to be used as extensions, while nodes are reserved to XSD... that would simplify a lot things... do you anything about it? |
That is correct indeed. I changed the naming to |
looks good, thank you |
Thank you @veewee |
Hello,
In WSDLs, it is possible that additional arguments are being added to the XSD configurations.
This information gets lost currently.
This PR introduces a system to collect this kind of information.
Currently it is only added for attributes, but it could as well be added for other types as well.
Example:
Currently the
wsdl:arrayType="int[]"
information gets lost.When this PR is merged, you will be able to read this additional (non standard XSD) information by doing:
This will return: