Schema Definition Error using Apache daffodil

65 views Asked by At

I am using cmd to parse a NITF file to xml. I run .\daffodil.bat parse --schema nitf.dfdl.xsd 2301573_3.ntf

The nitf.dfdl.xsd, nitf_common_types.dfdl.xsd, nitf_extension_types.dfdl.xsd and the NITF are contained in the same folder as the daffodil.bat file. The NITF schemas can be found here: https://github.com/DFDLSchemas/NITF/tree/master/src/main/resources/com/tresys/nitf/xsd

I am getting the following error:

C:\Users\rinat\apache-daffodil-3.5.0-bin\bin>daffodil.bat parse --schema nitf.dfdl.xsd 
2301573_4
[error] Schema Definition Error: Error loading schema due to org.xml.sax.SAXParseException; 
systemId: file:/C:/Users/rinat/apache-daffodil-3.5.0-bin/bin/nitf_extension_types.dfdl.xsd; 
lineNumber: 90; columnNumber: 129; src-resolve.4.1: Error resolving component 'JFIF'. It was 
detected that 'JFIF' has no namespace, but components with no target namespace are not 
referenceable from schema document 'file:/C:/Users/rinat/apache-daffodil-3.5.0- 
bin/bin/nitf_extension_types.dfdl.xsd'. If 'JFIF' is intended to have a namespace, perhaps a 
prefix needs to be provided. If it is intended that 'JFIF' has no namespace, then an 'import' 
without a "namespace" attribute should be added to 'file:/C:/Users/rinat/apache-daffodil- 
3.5.0-bin/bin/nitf_extension_types.dfdl.xsd'.
Schema context: file:/C:/Users/rinat/apache-daffodil-3.5.0-bin/bin/nitf.dfdl.xsd Location in 
file:/C:/Users/rinat/apache-daffodil-3.5.0-bin/bin/nitf.dfdl.xsd
[error] Schema Definition Error: Error loading schema due to org.xml.sax.SAXParseException; 
systemId: file:/C:/Users/rinat/apache-daffodil-3.5.0-bin/bin/nitf_extension_types.dfdl.xsd; 
lineNumber: 90; columnNumber: 129; src-resolve: Cannot resolve the name 'JFIF' to a(n) 
'element declaration' component.
Schema context: file:/C:/Users/rinat/apache-daffodil-3.5.0-bin/bin/nitf.dfdl.xsd Location in 
file:/C:/Users/rinat/apache-daffodil-3.5.0-bin/bin/nitf.dfdl.xsd

This is being caused by the line <xs:element name="JFIF" dfdl:choiceBranchKey="C3 M3 C5 M5 I1" dfdl:lengthKind="explicit" dfdl:length="{ ../PayloadLength }" in the nitf_extension_types.dfdl.xsd file. I am not sure what prefix to add or how to add an 'import without a namespace' attribute. I would appreciate any input. Thank you.

0

There are 0 answers