XISF Header doesn't align with spec

Issue #1230 resolved
Aaron Keck created an issue

Per XISF 1.0 spec (https://pixinsight.com/doc/docs/XISF-1.0-spec/XISF-1.0-spec.html#xisf_header)

A valid XISF header must begin with the following XML declaration:

<?xml version="1.0" encoding="UTF-8"?>

But based on a sample output XISF, it looks like files created by NINA omit the XML Declaration

<xisf version="1.0" xmlns="http://www.pixinsight.com/xisf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.pixinsight.com/xisf http://pixinsight.com/xisf/xisf-1.0.xsd">
          <Metadata>
            <Property id="XISF:CreationTime" type="TimePoint" comment="" value="2023-05-04T03:27:19.7133973Z" />
            <Property id="XISF:CreatorApplication" type="String" comment="">N.I.N.A. - Nighttime Imaging 'N' Astronomy</Property>
          </Metadata>
          ....

I think this aligns with the code in XISFHeader.cs: https://bitbucket.org/Isbeorn/nina/src/d2e422c5605b3c53c4631216c5cac1c822368e0e/NINA.Image/FileFormat/XISF/XISFHeader.cs?at=master#lines-841

OmitXmlDeclaration = true

Expected fix would maybe be something like

XmlDeclaration xmlDeclaration = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
doc.AppendChild(xmlDeclaration);

I’m not aware of any programs that fail to parse NINA’s XISF files, PixInsight itself opens them without complaint. This is just a nit-picky conformance bug.

Comments (3)

  1. Log in to comment