newline character at end of RawCoT causes issues
See original GitHub issueI was working on a custom application where I was generating an XML CoT using QT’s QXmlStreamWriter. This Application runs on a Desktop and streams CoT messages to the server at a 2 second interval. Then I use an android tablet running ATAK to view the friendly contact’s position.
Using QT’s documentation ending the XML Stream with
QXmlStreamWriter::writeEndDocument()
(to close out the writeStartDocument()
) adds a newline at the end of the XML.
On the server, the RawCoT.xmlString appears as:
[<?xml version="1.0" encoding="UTF-8" standalone="yes"?><event version="2.0" uid="MYCOT0" time="2021-08-25T00:15:32Z" start="2021-08-25T00:15:32Z" stale="2021-08-25T00:16:32Z" how="m-g" type="a-f-A"><point lat="34.0" lon="-118.0" hae="50" ce="9999999.0" le="9999999.0"/><detail><contact endpoint="*:-1:stcp" callsign="MYCOT"/><precisionlocation altsrc="GPS" geopointsrc="GPS"/><__group role="Team Member" name="Cyan"/><takv os="1" platform="qgc" version="1.0"/></detail></event>
]
This CoT then doesn’t update correctly on the clients. It stays in one position and bounces if the lat/lon changes.
Removing the QXmlStreamWriter::writeEndDocument()
results in
[<?xml version="1.0" encoding="UTF-8" standalone="yes"?><event version="2.0" uid="MYCOT0" time="2021-08-25T00:15:32Z" start="2021-08-25T00:15:32Z" stale="2021-08-25T00:16:32Z" how="m-g" type="a-f-A"><point lat="34.0" lon="-118.0" hae="50" ce="9999999.0" le="9999999.0"/><detail><contact endpoint="*:-1:stcp" callsign="MYCOT"/><precisionlocation altsrc="GPS" geopointsrc="GPS"/><__group role="Team Member" name="Cyan"/><takv os="1" platform="qgc" version="1.0"/></detail></event>]
With no newline at the end. This CoT message updates on my android ATAK client and everything looks correct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Have a look in the source for Atak in commoncommo
https://github.com/deptofdefense/AndroidTacticalAssaultKit-CIV/blob/master/commoncommo/core/impl/protobuf/protocol.txt
I think you’ll see the expected format of the XML in that file.
We do not suggest to use the XML for integration. use the REST API