Skip to content

n42 xml file created by SpecUtils is not valid according to xsd #12

@arichnad

Description

@arichnad

Hello,

issue-input.txt
issue-output.txt
(files added as .txt extension due to issue restriction)

I run the following valid 2012 n42 xml file through SpecUtils, and it creates a 2012 n42 xml that fails schema validation.

$ xmlstarlet val --err --xsd SpecUtils/unit_tests/test_data/schema/n42.xsd issue-input.xml
issue-input.xml - valid

It creates two errors. xmlstarlet val --err --xsd SpecUtils/unit_tests/test_data/schema/n42.xsd issue-output.xml

  1. An InterSpec definition needs to be added to the xml header:
22.27: Namespace prefix InterSpec on DetectorType is not defined
			<InterSpec:DetectorType>RS-701</InterSpec:DetectorType>
  1. And, it also creates a RadInstrementState that lacks a ref:
41.22: Element '{http://physics.nist.gov/N42/2011/N42}RadInstrumentState': The attribute 'radInstrumentInformationReference' is required but missing.

Using this:

SpecFile specFile;
if(!specFile.load_N42_from_data(inputContent)) {
	return;
}
specFile.write_to_file(outputFilename, SaveSpectrumAsType::N42_2012);

Thanks,

arichnad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions