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

XsdParserJar::parseJarFile fails for valid schema compared to XsdParser #32

Closed
msbukal opened this issue Nov 10, 2020 · 6 comments
Closed

Comments

@msbukal
Copy link

msbukal commented Nov 10, 2020

Hi,

My schema fails parsing with "The top level element of a XSD file should be the xsd:schema node" at XsdParserJar::parseJarFile.

I know my schema is valid because it successfully runs when I use the XsdParser with a local path. When I changed it to use the XsdParserJar with the files packaged within the .jar it fails. I removed all comments and text above the root xsd:schema node in all the .xsd files, but it still fails.

I notice the XsdParser checks all its children in XsdParser::getSchemaNode and returns the first schema node, but in the XsdParserJar::getSchemaNode only the first child node is returned.

I think this difference is caused by only fixing the issue reported here: #7 for the XsdParser.

Would it be possible to fix this for the XsdParserJar too?

Thanks!
Milena

@lcduarte
Copy link
Member

Hello,

Yeah, that is most likely the problem, I haven't being paying attention to the Jar version. Can you provide me with the example that doesn't work so I can test it out? Alternatively you can create a pull request with the fix and I'll check it out and create a new release.

Thanks

@msbukal
Copy link
Author

msbukal commented Nov 11, 2020

I'm using the HL7 CDA schema, and I added the schema files under src/main/resources with

sourceSets {
        ...
        resources {
            ...
            srcDirs('src/main/resources')
        }
    }
}

in my build.gradle, which puts them at the root of the jar.

@lcduarte
Copy link
Member

Hello,

I've pushed you suggestion, try it out and if it solves your problem I'll perform a new release.

@msbukal
Copy link
Author

msbukal commented Nov 17, 2020

Yes it fixed the issue! Thank you.

@lcduarte
Copy link
Member

Great!

I'll try to release the new version today. I'm having some troubles since the deployment server is giving me timeout, I'll update you when its done.

@lcduarte
Copy link
Member

Guess it was too early in the day, its working now :) I've deployed the new version, (1.1.3), with the fix.

Thanks for using the library, if you find any more issues let me know!

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

No branches or pull requests

2 participants