Updater writes invalid emitter description (national nomenclature) when CR...
Brought to you by:
grahamshanks,
mpenkrot
Updater is producing invalid XML when CR attempts to remove the national nomenclature. The XML file contains a space for the description attribute (used for the national nomenclature value).
This is occurring on CR 5041 row 45:
Change Type | Value | National Nomenclature | NATO Reporting Name | Commercial Designation | Comment (not included in XML DB or products) | Footnote (included in XML DB and products) | UUID |
---|---|---|---|---|---|---|---|
Update | 26935 | SA-26 Pechora-2M TT |
The cell for National Nomenclature is empty.
Stepping through the code for Updater shows that the value is coming out of the CR as an empty string, but when the file is saved as XML it contains a " ".
Before
<enumrow value="26935" description="SA Pechora 2M TT" uuid="1cc62799-54f9-472b-8a39-10d9a7c4416c">
<cr value="2853" />
</enumrow>
After:
<enumrow value="26935" description=" " uuid="1cc62799-54f9-472b-8a39-10d9a7c4416c" status="new">
<cr value="2853" />
<cr value="5041" />
<meta key="natoid" value="SA-26 Pechora-2M TT" />
</enumrow>
The space character is causing the Validator to give the following error:
Fatal error: XML schema validation error at line 77212, column 28: The 'description' attribute is invalid - The value ' ' is invalid according to its datatype 'String' - The Pattern constraint failed.
It appears to be the following line of code in SharpESI.ElectromagneticEmitter.NationalNomenclature.set() that is inserting the space:
Here's the full block of code:
Here is the recommended replacement: