I create with the QDomDocument several QDomElements:
bams.setAttribute("rippleFilter", m_nRifi);
bams.setAttribute("rangeShifter", m_nRashi);
bams.setAttribute("rangeShifterDistance", m_lfRaShiDistance);
domNode.appendChild(bams);
table.setAttribute("roll", m_fRoll);
table.setAttribute("pitch", m_fPitch);
table.setAttribute("lateral", m_fLateral);
table.setAttribute("longitudinal", m_fLongitudinal);
table.setAttribute("isocentricAngle", m_fIsoAngle);
table.setAttribute("vertical", m_fVertical);
domNode.appendChild(table);
QDomElement bams = domDoc.createElement("BAMS");
bams.setAttribute("rippleFilter", m_nRifi);
bams.setAttribute("rangeShifter", m_nRashi);
bams.setAttribute("rangeShifterDistance", m_lfRaShiDistance);
domNode.appendChild(bams);
QDomElement table = domDoc.createElement("TxTable");
table.setAttribute("roll", m_fRoll);
table.setAttribute("pitch", m_fPitch);
table.setAttribute("lateral", m_fLateral);
table.setAttribute("longitudinal", m_fLongitudinal);
table.setAttribute("isocentricAngle", m_fIsoAngle);
table.setAttribute("vertical", m_fVertical);
domNode.appendChild(table);
To copy to clipboard, switch view to plain text mode
The output is:
<BAMS rangeShifterDistance="0" rippleFilter="0" rangeShifter="0"/>
<TxTable vertical="0" longitudinal="0" lateral="0" isocentricAngle="0" pitch="0" roll="0"/>
Is there any possibility to preserve the order of attributes?
Bookmarks