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

[BUG] Jaxp does not let you validate XML Schema validity #5541

Open
ahenket opened this issue Nov 6, 2024 · 1 comment
Open

[BUG] Jaxp does not let you validate XML Schema validity #5541

ahenket opened this issue Nov 6, 2024 · 1 comment
Assignees
Labels
investigate issues being looked at

Comments

@ahenket
Copy link

ahenket commented Nov 6, 2024

We have a routine that validates instances against self-generated xsds. It's a rare thing but every once in a while, the xsd itself is in question, so instead of marking every instance as invalid I would like to notify that the schema itself is invalid.

The way to do that seems to be:
validation:jaxp(xs:anyURI('my.xsd'), true())
validation:jaxp(xs:anyURI('my.xsd'), false())

(both always return false() regardless of schema validity)
or

validation:pre-parse-grammar(xs:anyURI('my.xsd'))
(returns “Cannot invoke “Object.toString()” because “value” is null”)

validation:pre-parse-grammar(doc('my.xsd'))
(returns “Only XMLSchemas can be preparsed.“)

Environment
eXist-db 6.2 - Any hints? Obviously “my.xsd” is something that resolves when I run it

@dizzzz
Copy link
Member

dizzzz commented Nov 6, 2024

Please could you check if cleaning the grammar cache solves the issue?

if the pre-parse fails (quite ugly i'd say) I guess a crucial errorhandling is missing;

is there anything in the logs? Can you share the XSD?

@dizzzz dizzzz self-assigned this Nov 6, 2024
@dizzzz dizzzz added the investigate issues being looked at label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate issues being looked at
Projects
None yet
Development

No branches or pull requests

2 participants