Comments (5)
I am not entirely sure, but this could be an easy fix. At least a very brief look at the code suggests that.
We cache XSD files we already read
Lines 65 to 67 in c0fa9ed
and few lines below we load all the imports of the current file:
Lines 73 to 75 in c0fa9ed
Potentially we just need to wrap this si.load()
call with an if that will ensure not to load schemas that have been already loaded.
Not sure however, if the compilation of the xsd schemas won't fail later on. Would you like to explore this and propose a patch?
Thanks!
from xsd2go.
I think the sub-schemas are then missing in the workspace, leading to missing types. I will try to remove the recursion and collect all imports - split parse and compile.
from xsd2go.
Hello @dratasich,
Your analysis seems to be correct. There is circular dependency in these XSD files and current codebase does not account for such case.
from xsd2go.
Cool, thanks @isimluk for pointing out the responsible code parts.
With
for idx := range schema.Imports {
childXsdPath := filepath.Join(dir, schema.Imports[idx].SchemaLocation)
_, found := ws.Cache[childXsdPath]
if found {
continue
}
if err := schema.Imports[idx].load(ws, dir); err != nil {
return nil, err
}
}
I could avoid the stack overflow - thanks again!
Unfortunately I still have an error, so I have to check if its a model error (my guess) or if I miss a type due to this change.
./gocomply_xsd2go convert ~/repos/parkandride-api/gen/3.4/DATEXII_3_LocationReferencing.xsd datex3 .
Processing '/home/denise/repos/parkandride-api/gen/3.4/DATEXII_3_LocationReferencing.xsd'
Parsing: /home/denise/repos/parkandride-api/gen/3.4/DATEXII_3_LocationReferencing.xsd
Parsing: /home/denise/repos/parkandride-api/gen/3.4/DATEXII_3_LocationReferencing.xsd
Parsing: /home/denise/repos/parkandride-api/gen/3.4/DATEXII_3_Common.xsd
panic: Cannot resolve type reference: com:Boolean
from xsd2go.
I succeeded to generate Go code with xgen -l Go
(and Java code with jaxb
with a bindings.xml
/ config).
To cope with circular imports I think it would need a bigger restructuring/rewriting in the xsd/workspace.go
file.
So I will close this issue here.
from xsd2go.
Related Issues (20)
- add support for xsd:duration
- panic: Type xsd:Name not implemented
- Exporting an unexported type
- Unknown xmlns prefix HOT 6
- XMLName element has invalid xml tag HOT 2
- panic: Type xsd:unsignedInt not implemented HOT 2
- Handle multiple XSD files? HOT 3
- Add xs:union support
- Type xsd:long is not implemented HOT 2
- [0.1.4] Generated types incomplete with no errors or warnings HOT 4
- Type xsd:float not implemented HOT 1
- panic: Type xsd:negativeInteger not implemented
- panic: Type xsd:language not implemented
- ISO-8859-1 encoded XSD failes. HOT 2
- Type xsd:IDREF not implemented
- panic: Type xsd:time not implemented HOT 4
- xsd:positiveInteger is not implemented HOT 1
- Cannot resolve type reference: integer HOT 2
- Nothing generated from XSD
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xsd2go.