When I analyze purposefully distorted OME-XML file using the command line tools, the command line output looks like this.
- Code: Select all
>> [status,res]= system(sprintf('%s "%s"',xmlvalid,"C:\xxxxxxxxxx\Desktop\boats.ome.xml"))
status =
0
res =
'Parsing schema path
Error parsing schema path from C:\xxxxxxxxxx\Desktop\boats.ome.xml
org.xml.sax.SAXParseException: Attribute "PhysicalSizeXUnit" was already specified for element "Pixels".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[bioformats_package.jar:5.8.2]
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) ~[bioformats_package.jar:5.8.2]
at javax.xml.parsers.SAXParser.parse(Unknown Source) ~[na:1.8.0_191]
at loci.common.xml.XMLTools.validateXML(XMLTools.java:653) [bioformats_package.jar:5.8.2]
at loci.common.xml.XMLTools.validateXML(XMLTools.java:627) [bioformats_package.jar:5.8.2]
at loci.formats.tools.XMLValidate.process(XMLValidate.java:60) [bioformats_package.jar:5.8.2]
at loci.formats.tools.XMLValidate.main(XMLValidate.java:81) [bioformats_package.jar:5.8.2]
'
The most of the stack tace is not useful, but the line "org.xml.sax.SAXParseException: Attribute "PhysicalSizeXUnit" was already specified for element "Pixels"." is crucial.
At the moment, when I run `res = loci.common.xml.XMLTools.validateXML(xml, "XML");` instead, initially there was no command line output.
Using this
- Code: Select all
loci.common.DebugTools.enableLogging();
resulted in the command line output as below (much simpler than the above):
- Code: Select all
Parsing schema path
Error parsing schema path from XML
futher executing
- Code: Select all
loci.common.DebugTools.setRootLevel('DEBUG');
or
- Code: Select all
loci.common.DebugTools.setRootLevel('INFO');
or
- Code: Select all
loci.common.DebugTools.enableIJLogging(true);
doesn't seem to make a difference.
Looking at the source code (
https://github.com/ome/ome-common-java/ ... .java#L788), perhaps I need to specify the third input argument `schemaReader` to get a detailed error message??? I don't really know what `schemaReader` is about, though.