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

XML-hul 1.5.3: schemaLocation attribute parser is too strict about whitespace in pairs of NS and schema location URI #883

Closed
UmbrellaDish opened this issue Oct 17, 2023 · 1 comment · Fixed by #889 or #906
Labels
bug A product defect that needs fixing
Milestone

Comments

@UmbrellaDish
Copy link

In JHOVE 1.28, the status of an invalid xml turns out to be "Well-formed" instead of "Well-formed, but invalid" if there are two or more whitespace characters for instance separating paired namespace URI and the corresponding schema location URI. No list of errors is given, so I deem validation is not taking place to begin with. Once I reduce the sequence of whitespace to one, schema is loaded and properly validated against.

I am not sure I read the right specification correctly maybe I have missed some "single whitespace within NS+location pairs in schemaLocation" rule, but to me it looks like a bug. Intuitively, what is key and value to be stored in the internal map should be inferred from their position in the list. If said rule exists, would it not need to be validated as well and be an error when wrong?

@david-russo
Copy link
Member

You're correct, that's a bug. The current code only expects a single whitespace where it should allow any amount of whitespace.

I've submitted a PR which should fix the issue.

@david-russo david-russo added the bug A product defect that needs fixing label Oct 24, 2023
@carlwilson carlwilson linked a pull request Mar 4, 2024 that will close this issue
@carlwilson carlwilson added this to the JHOVE 1.30 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A product defect that needs fixing
Projects
None yet
3 participants