-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Interspec v 1.0.10 rc2
I used the Interspec "Export" function to produce a N42 (2012) file. This file looks like this (with some sections removed):
<?xml version="1.0" encoding="utf-8"?> <RadInstrumentData n42DocUUID="92fc70f2-0f2d-4ac3-8018-2cf53b5b7b3c" xmlns="http://physics.nist.gov/N42/2011/N42" n42DocDateTime="2022-06-08T21:09:54Z"> <Remark>Source of intrinsic activity:Cesium137</Remark> <RadInstrumentDataCreatorName>InterSpec</RadInstrumentDataCreatorName> ... <RadMeasurement id="Sample1"> ... </RadMeasurement> ... <DHS:InterSpec version="1"> <DisplayedSampleNumbers>2</DisplayedSampleNumbers> ... </DHS:InterSpec> </RadInstrumentData>
The "DHS" namespace designation in <DHS:InterSpec> is not defined in the document as required by the XML standard (i.e. using an xmlsn=....). This makes the file unparseable by the python package lxml due it the non-compliance with the XML standard. As lxml is based on libxml2, presumably that package will also have trouble parsing these files.
lxml error message:
Namespace prefix DHS on Interspec is not defined, line xx, column yy
I suggest this issue be corrected by defining the DHS namespace in the output xml. While different parsers may be more or less tolerant of this issue, my understanding is that lxml is correct here in objecting to the use of an undefined namespace (even if I wish it might "loosen up a little" and parse the file regardless of this issue).