-
Notifications
You must be signed in to change notification settings - Fork 115
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
Use Import / Included schemas for code Generation #68
Comments
The current handling of imports is a bit of a hack. The xsdgen tool requires that you provide paths to all required files on the command line, including files imported by an XSD, and imports of imports and so on. #35 is open to have a utility to retrieve those files recursively. So as far as I can tell, you should be able to generate code for your schema, you will just have to go through the extremely tedious process of acquiring and referencing all of the relevant XSD files. If that is feasible, you can try that and let me know if it doesn't work. If it does work we can mark this issue as a duplicate of #35. |
I have a case where all the files necessary are available in a single directory. Handing
Am I missing something here? or is this not expected to work? |
This is expected to work. Looking at your example I see "id-type" defined in gexf.xsd, under targetNamespace "http://www.gexf.net/1.2draft", defined here. It's then used in data.xsd. I believe what is happening is that the same targetNamespace is split across multiple files. The way There is a step during the xsd parsing process, resolvePartialTypes, that looks up types like |
I believe I've handled the splitting of namespaces across files in my PR. I'm sure it needs work, and you may prefer it be handled in another manner else where within the logic, but it may be a start. |
this is an older issue but I ran into the same problem. I took a crack at resolving it on a local branch by:
this seems to work, as it satisfies the assumptions of the if this approach seems reasonable I am happy to offer these changes as a pull request for consideration. |
I didn't find the PR that @aaronmmanzano mentioned until this morning, I assume that #72 is it? I'm going to have a look through to catch up on what I missed in the conversation and see how I can help. |
PR #72 has some merge conflicts with In the meantime, here are a pair of PRs, separated as I think they serve different purposes, for consideration:
|
I also ran into this issue when generating code for Onix 3.0. For me, I had to manually merge the 3 files for the generation to succeed. |
I suggest using fixtrading.org XSD since it is very complex. |
Currently it appears the XSDGEN tool does not reference and included/imported schema files.
There is an 'Import' function in the Parser code, but unclear how to use it.
Is there any documentation on how to Code-Gen an XSD Schema that uses extensive external imports ?
My use case is an open standard domain specific XML Schema, which has an extensive data model and uses about 20 different included files (With nested includes/imports).
I can share the entire schema if required as it is public.
The text was updated successfully, but these errors were encountered: