Closed bitsgalore closed 2 years ago
Update: namespace issue is caused because I accidentally ran checkFiles without setting:
config.INPUT_WRAPPER_FLAG = True
Slightly confusing bc default value (as per config file) is "False", is later set to "True". Fixed by https://github.com/openpreserve/jpylyzer/commit/0906e7341383e6d96336a282ff96ef44b0f47223.
Running a modified version of the jpylyzer test corpus tests on openjpeg-data give some weird results. See below script (for simplicity input restricted to input/conformance dir):
Problem 1: namespace issue
Majority of files fail with error below:
Going by the error description the problem is a duplicate attribute definition in the XML. By adding a debug statement just before the toprettyxml call I was able to narrow this down for "file8.jp2" to a duplicate definition of the xmlns:xsi namespace. First it is declared in the root element:
and then again in the file element:
This happens the ns declaration in the root element is inserted using simple text manipulation, so the XML writer that processes the xmlElement for each file is unaware of it:
Oddly I'm not able to reproduce this error outside of PyTest (running jpylyzer directly on affected files does not result in any issues, and XML is valid).
BUT I don't think this can cause the fail in PyTest!
Problem 2: missing files in output
Also tried this:
Resulting XML contains output for 57 files, but directory contains 59 files.
Needs further investigation.
Update: this seems to be a bug in my text editor; double-check with xmllint confirmed no. of elements is in fact identical to no. of files!