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

Set cwd when xsd2py is executed as __main__ and ignore xsd imports #84

Closed
wants to merge 1 commit into from
Closed

Conversation

iurisilvio
Copy link
Contributor

if file does not exist, to support external schemaLocations.

Fix #83

if file does not exist, to support external schemaLocations.
@@ -69,6 +69,8 @@ def rewrite_paths(schema, cwd, base_path):

def resolve_import(xsdimport, known_files, parent_namespace, cwd, base_path):
location = os.path.join(base_path, xsdimport.schemaLocation)
if not os.path.isfile(location):
return ''
Copy link
Member

@ngnpope ngnpope Jun 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alas it is not this simple. If we do not process imports from remote locations, we do not generate code.

I think I have worked out where the issue is now, so should have a solution soon. Unfortunately it requires keeping track of whether an import was local or remote and propagating that state down the tree of imports.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. The external URL must be handled. I didn't had time to work on this issue. It was to ignore these imports:

 <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
 <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />

I think if no schemaLocation is set, just ignore the import.

@FelixSchwarz
Copy link
Member

@iurisilvio @pope1ni How should we proceed here? Nick do you have a commit which fixes this? I saw 056fc0d so I assume you will fix that? Should we just abandon this pull request?

@iurisilvio
Copy link
Contributor Author

I think @pope1ni is right with 056fc0d and we should consider external files. The cwd must be passed to generate_code_from_xsd, so part of this pull request is good.

@iurisilvio
Copy link
Contributor Author

Closing pull request in favor of other solutions.

@iurisilvio iurisilvio closed this Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants