0

I am trying to convert XML data to a javascript object and for this, I am using the below function
let xmlFileData = convert.xml2js(xmlfile, { compact: true });
But the issue I am facing over here is the sequence of the converted data is not the same as the original data. For ex :
Original Data Seq = Nosecone, BodyTube, Transition
Converted data seq = BodyTube, Nosecone, Transition

Does anyone know how can we preserve the sequence while converting the data?

I want the sequnce of resulted data should be same as orignial data.

Moussa Bistami
  • 929
  • 5
  • 15
  • Your should provide an example of the data you are processing. Please be aware that javascript objects are key-value-pairs, which are not ordered by design. If you need ordered elements, an array should be used. – Fabian Strathaus Nov 23 '22 at 10:30

0 Answers0