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

Unsolved References are not correct #60

Closed
darthweiter opened this issue Feb 24, 2024 · 3 comments
Closed

Unsolved References are not correct #60

darthweiter opened this issue Feb 24, 2024 · 3 comments

Comments

@darthweiter
Copy link
Contributor

Describe the bug
The Unsolved References are not correct and there are multiple problems i encountered.
1.: the transitive includes are not correct, but there is a fix -> #58
2.: the includes are not considered on imported files, so they aren't resolved
example: a.xsd A import b.xsd B
b.xsd include c.xsd C
so if a.xsd use type B:TypeFrom C they are not include
3.: the unsolved elements are not always using the correct filename, they use the last filename in the parser. So the Problem is, there are
unsolved elements shown under filenames, that doesn't exist

Expected behavior
There are no Unsolved References.

Library Version
1.2.7

Additional context
Attach the XSD file or a similar example that you are trying to parse.
if i try to parse the BBK_RIAD_V2.4-SDMX.xsd, i encountered the Problem.

@darthweiter darthweiter mentioned this issue Feb 24, 2024
@darthweiter
Copy link
Contributor Author

relates to #58

@lcduarte
Copy link
Member

I've rejected the PR but I've implemented some of the ideas that were there. The need for that method that clears and rebuilds the UnsolvedReferences is wrong because it only hides the problem instead of solving it at its origin, but after spending quite a bit of time trying the understand why that code solves the issue I couldn't find it. It will probably become a permanent "temporary" solution 😄

I've released a new version, 1.2.8, with the code for this issue.

@darthweiter
Copy link
Contributor Author

All Right, and yeah it doesn't solve the problem at the root.
The idea of the clear of the unsolved reference is to fix the wrong filepath and build it from the right XsdSchema of them, so all unsolved elements have the correct filepath so you can resolve them as normal.
I tested it with the sdmx-schemas
and there was UnsolvedReference ItemWhere in SDMXDataGenericTimeSeries, but there was no such element present in this file.
In the Method addUnsolvedReference, you use the currentFilePath if no schema is present. But this looks like not correct, i think this is the last file you used with the parser but i havn't found the root problem.

I will look into 1.2.8 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants